Bug 1252082 - prevent null pointer dereference on |c|. r=sebastian
authorBogdan Postelnicu <bogdan.postelnicu@softvision.ro>
Tue, 01 Mar 2016 21:21:16 +0200
changeset 322683 1846e981637e0547c9b7935b2329580e03780259
parent 322682 3c029ca3348afac9f1d9413a2127e5e62535f80e
child 322684 e13aaaaf196229acb1bcd77f0ab9e5ad3ada7d9a
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssebastian
bugs1252082
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1252082 - prevent null pointer dereference on |c|. r=sebastian MozReview-Commit-ID: 1ApWSRDUYMJ
mobile/android/base/java/org/mozilla/gecko/ReadingListHelper.java
--- a/mobile/android/base/java/org/mozilla/gecko/ReadingListHelper.java
+++ b/mobile/android/base/java/org/mozilla/gecko/ReadingListHelper.java
@@ -245,16 +245,19 @@ public final class ReadingListHelper imp
         });
     }
 
     private void fetchContent() {
         ThreadUtils.postToBackgroundThread(new Runnable() {
             @Override
             public void run() {
                 final Cursor c = readingListAccessor.getReadingListUnfetched(context.getContentResolver());
+                if (c == null) {
+                    return;
+                }
                 try {
                     while (c.moveToNext()) {
                         JSONObject json = new JSONObject();
                         try {
                             json.put("id", c.getInt(c.getColumnIndexOrThrow(ReadingListItems._ID)));
                             json.put("url", c.getString(c.getColumnIndexOrThrow(ReadingListItems.URL)));
                             GeckoAppShell.sendEventToGecko(
                                 GeckoEvent.createBroadcastEvent("Reader:FetchContent", json.toString()));