Bug 707150 - Fix NullPointerException when getting IS_FOLDER (r=blassey)
authorLucas Rocha <lucasr@mozilla.com>
Wed, 11 Jan 2012 19:47:19 +0000
changeset 85530 87b138f5e7829a9777777d64ba4ef075bad66685
parent 85529 5660fa471b73d15716a15d0b308c5aaf81a24581
child 85531 e897ce4266159516568f8a095629010de5c55ef9
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersblassey
bugs707150
milestone12.0a1
Bug 707150 - Fix NullPointerException when getting IS_FOLDER (r=blassey)
mobile/android/base/db/BrowserProvider.java.in
--- a/mobile/android/base/db/BrowserProvider.java.in
+++ b/mobile/android/base/db/BrowserProvider.java.in
@@ -688,19 +688,19 @@ public class BrowserProvider extends Con
 
                 if (!values.containsKey(Bookmarks.POSITION)) {
                     Log.d(LOGTAG, "Inserting bookmark with no position for URI");
                     values.put(Bookmarks.POSITION, Long.toString(Long.MIN_VALUE));
                 }
 
                 String url = values.getAsString(Bookmarks.URL);
                 ContentValues imageValues = extractImageValues(values, url);
-                Boolean isFolder = values.getAsInteger(Bookmarks.IS_FOLDER) == 1;
+                Integer isFolder = values.getAsInteger(Bookmarks.IS_FOLDER);
 
-                if ((isFolder == null || !isFolder) && imageValues != null
+                if ((isFolder == null || isFolder != 1) && imageValues != null
                         && !TextUtils.isEmpty(url)) {
                     Log.d(LOGTAG, "Inserting bookmark image for URL: " + url);
                     updateOrInsertImage(uri, imageValues, Images.URL + " = ?",
                             new String[] { url });
                 }
 
                 Log.d(LOGTAG, "Inserting bookmark in database with URL: " + url);
                 id = db.insertOrThrow(TABLE_BOOKMARKS, Bookmarks.TITLE, values);