Null check

 Bug: 5006765
 This can happen if we are destroyed before the initial load is received

Change-Id: Ic285ec81abf6838eaa2fe212f55703093d5d5a86
diff --git a/src/com/android/browser/BrowserSnapshotPage.java b/src/com/android/browser/BrowserSnapshotPage.java
index 72da15b..44c419e 100644
--- a/src/com/android/browser/BrowserSnapshotPage.java
+++ b/src/com/android/browser/BrowserSnapshotPage.java
@@ -98,8 +98,10 @@
     public void onDestroyView() {
         super.onDestroyView();
         getLoaderManager().destroyLoader(LOADER_SNAPSHOTS);
-        mAdapter.changeCursor(null);
-        mAdapter = null;
+        if (mAdapter != null) {
+            mAdapter.changeCursor(null);
+            mAdapter = null;
+        }
     }
 
     void setupGrid(LayoutInflater inflater) {