Bug 1226523 - Fennec crashes after transferring bookmarks and history. r=margaret, a=lizzard
authorChenxia Liu <liuche@mozilla.com>
Mon, 23 Nov 2015 11:30:07 -0500
changeset 305649 91b7f25540f09d595c5638ea0f9e60bd810cad50
parent 305648 23f7d90263fbda76ad0e287784ed9b0f3c5d82d2
child 305650 d91dbc0c93149d4145239536cb96f4b049da9c62
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret, lizzard
bugs1226523
milestone44.0a2
Bug 1226523 - Fennec crashes after transferring bookmarks and history. r=margaret, a=lizzard
mobile/android/base/preferences/AndroidImport.java
--- a/mobile/android/base/preferences/AndroidImport.java
+++ b/mobile/android/base/preferences/AndroidImport.java
@@ -72,17 +72,17 @@ public class AndroidImport implements Ru
         Cursor cursor = null;
         try {
             cursor = mCr.query(LegacyBrowserProvider.BOOKMARKS_URI,
                                null,
                                LegacyBrowserProvider.BookmarkColumns.BOOKMARK + " = 1",
                                null,
                                null);
 
-            if (Build.MANUFACTURER.equals(SAMSUNG_MANUFACTURER) && cursor.getCount() == 0) {
+            if (Build.MANUFACTURER.equals(SAMSUNG_MANUFACTURER) && cursor != null && cursor.getCount() == 0) {
                 cursor = mCr.query(SAMSUNG_BOOKMARKS_URI, null, null, null, null);
             }
 
             if (cursor != null) {
                 final int faviconCol = cursor.getColumnIndexOrThrow(LegacyBrowserProvider.BookmarkColumns.FAVICON);
                 final int titleCol = cursor.getColumnIndexOrThrow(LegacyBrowserProvider.BookmarkColumns.TITLE);
                 final int urlCol = cursor.getColumnIndexOrThrow(LegacyBrowserProvider.BookmarkColumns.URL);
                 // http://code.google.com/p/android/issues/detail?id=17969