Bug 917396: Crash in resetting the loader. [r=lucasr, a=lsblakk]
authorSriram Ramasubramanian <sriram@mozilla.com>
Wed, 18 Sep 2013 10:05:43 -0400
changeset 160506 40b02c6fdbb22ccfd1fefb7ed986a62f04194f00
parent 160505 c44623ea46eae29ccb7479fbaa8d096b4a84b416
child 160507 7951523d9b542c10c7925df9e13e6b604f6b0df8
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslucasr, lsblakk
bugs917396
milestone26.0a2
Bug 917396: Crash in resetting the loader. [r=lucasr, a=lsblakk]
mobile/android/base/home/TopSitesPage.java
--- a/mobile/android/base/home/TopSitesPage.java
+++ b/mobile/android/base/home/TopSitesPage.java
@@ -537,19 +537,23 @@ public class TopSitesPage extends HomeFr
             }
         }
 
         @Override
         public void onLoaderReset(Loader<Cursor> loader) {
             final int id = loader.getId();
 
             if (id == LOADER_ID_TOP_SITES_LIST) {
-                mListAdapter.swapCursor(null);
+                if (mListAdapter != null) {
+                    mListAdapter.swapCursor(null);
+                }
             } else if (id == LOADER_ID_TOP_SITES_GRID) {
-                mGridAdapter.swapCursor(null);
+                if (mGridAdapter != null) {
+                    mGridAdapter.swapCursor(null);
+                }
             }
         }
     }
 
     /**
      * An AsyncTaskLoader to load the thumbnails from a cursor.
      */
     private static class ThumbnailsLoader extends AsyncTaskLoader<Map<String, Thumbnail>> {