Bug 797430 - Fix cannot move a bookmark separator by drag & drop. r=mak
authorOHZEKI Tetsuharu <saneyuki.s.snyk@gmail.com>
Wed, 03 Oct 2012 18:19:23 -0400
changeset 109250 09c4dd7bf7d6273f85db1e5b11a1e064e4650aaf
parent 109249 5433c7edcc86883617b3cc3b87105765c297f99e
child 109251 ae646840907e8d704a6b252b349419e495e19b5a
child 109268 41d840c9cf301290affa11fe7bcc67711dfbeb84
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
reviewersmak
bugs797430
milestone18.0a1
Bug 797430 - Fix cannot move a bookmark separator by drag & drop. r=mak
browser/components/places/content/controller.js
--- a/browser/components/places/content/controller.js
+++ b/browser/components/places/content/controller.js
@@ -1420,23 +1420,23 @@ let PlacesControllerDragHelper = {
       catch (e) {
         return false;
       }
 
       // Only bookmarks and urls can be dropped into tag containers.
       if (ip.isTag && ip.orientation == Ci.nsITreeView.DROP_ON &&
           dragged.type != PlacesUtils.TYPE_X_MOZ_URL &&
           (dragged.type != PlacesUtils.TYPE_X_MOZ_PLACE ||
-           dragged.uri.startsWith("place:")))
+           (dragged.uri && dragged.uri.startsWith("place:")) ))
         return false;
 
       // The following loop disallows the dropping of a folder on itself or
       // on any of its descendants.
       if (dragged.type == PlacesUtils.TYPE_X_MOZ_PLACE_CONTAINER ||
-          dragged.uri.startsWith("place:")) {
+          (dragged.uri && dragged.uri.startsWith("place:")) ) {
         let parentId = ip.itemId;
         while (parentId != PlacesUtils.placesRootId) {
           if (dragged.concreteId == parentId || dragged.id == parentId)
             return false;
           parentId = PlacesUtils.bookmarks.getFolderIdForItem(parentId);
         }
       }
     }