Bug 995420 - Make sure cursor returned from HomeProvider isn't null. r=lucasr
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Tue, 15 Apr 2014 12:07:34 -0700
changeset 197083 ed34a62621f82aede598e2e42d2963a913d88f86
parent 197082 c80c6685d1e04357c20904d5eb637e56390662cb
child 197084 b1470828166b32644b10136e9aed5834e42beca7
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslucasr
bugs995420
milestone31.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 995420 - Make sure cursor returned from HomeProvider isn't null. r=lucasr
mobile/android/base/home/DynamicPanel.java
--- a/mobile/android/base/home/DynamicPanel.java
+++ b/mobile/android/base/home/DynamicPanel.java
@@ -408,18 +408,21 @@ public class DynamicPanel extends HomeFr
             } else {
                 selection = DBUtils.concatenateWhere(HomeItems.DATASET_ID + " = ?", HomeItems.FILTER + " = ?");
                 selectionArgs = new String[] { mRequest.getDatasetId(), mRequest.getFilter() };
             }
 
             // XXX: You can use CONTENT_FAKE_URI for development to pull items from fake_home_items.json.
             final Cursor c = cr.query(HomeItems.CONTENT_URI, null, selection, selectionArgs, null);
 
-            final Uri notificationUri = getDatasetNotificationUri(mRequest.getDatasetId());
-            c.setNotificationUri(cr, notificationUri);
+            // SQLiteBridgeContentProvider may return a null Cursor if the database hasn't been created yet.
+            if (c != null) {
+                final Uri notificationUri = getDatasetNotificationUri(mRequest.getDatasetId());
+                c.setNotificationUri(cr, notificationUri);
+            }
 
             return c;
         }
     }
 
     /**
      * LoaderCallbacks implementation that interacts with the LoaderManager.
      */