Bug 883500 - Update query to avoid bookmarks with null URLs (r=mfinkle, a=bajaj)
authorLucas Rocha <lucasr@mozilla.com>
Mon, 18 Nov 2013 15:40:27 -0800
changeset 166568 fa324ac537dd58ff6674f9e5123b2a04519ee780
parent 166567 797ace61ac852fe3ba7df0328e495011859ab168
child 166569 edcf89fbe953b64a1c6c47134cf13ffac9641d70
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle, bajaj
bugs883500
milestone27.0a2
Bug 883500 - Update query to avoid bookmarks with null URLs (r=mfinkle, a=bajaj)
mobile/android/base/db/LocalBrowserDB.java
--- a/mobile/android/base/db/LocalBrowserDB.java
+++ b/mobile/android/base/db/LocalBrowserDB.java
@@ -395,20 +395,21 @@ public class LocalBrowserDB implements B
                                         Bookmarks.UNFILED_FOLDER_GUID },
                          null);
         } else {
             // Right now, we only support showing folder and bookmark type of
             // entries. We should add support for other types though (bug 737024)
             c = cr.query(mBookmarksUriWithProfile,
                          DEFAULT_BOOKMARK_COLUMNS,
                          Bookmarks.PARENT + " = ? AND " +
-                         "(" + Bookmarks.TYPE + " = ? OR " + Bookmarks.TYPE + " = ?)",
+                         "(" + Bookmarks.TYPE + " = ? OR " +
+                            "(" + Bookmarks.TYPE + " = ? AND " + Bookmarks.URL + " IS NOT NULL))",
                          new String[] { String.valueOf(folderId),
-                                        String.valueOf(Bookmarks.TYPE_BOOKMARK),
-                                        String.valueOf(Bookmarks.TYPE_FOLDER) },
+                                        String.valueOf(Bookmarks.TYPE_FOLDER),
+                                        String.valueOf(Bookmarks.TYPE_BOOKMARK) },
                          null);
         }
 
         if (addDesktopFolder) {
             // Wrap cursor to add fake desktop bookmarks and reading list folders
             c = new SpecialFoldersCursorWrapper(c, addDesktopFolder);
         }