OSDN Git Service

Fix 2583234 - It's ok for mCallbacks to be null.
authorJoe Onorato <joeo@android.com>
Wed, 14 Apr 2010 00:19:18 +0000 (17:19 -0700)
committerJoe Onorato <joeo@android.com>
Wed, 14 Apr 2010 00:19:18 +0000 (17:19 -0700)
Change-Id: Iec8df7b668a4657677f9c5421d00aa1b7df91015

src/com/android/launcher2/LauncherModel.java

index 72675b9..5e1abe6 100644 (file)
@@ -432,7 +432,7 @@ public class LauncherModel extends BroadcastReceiver {
                     Log.d(TAG, "startLoader isLaunching=" + isLaunching);
                 }
                 // Don't bother to start the thread if we know it's not going to do anything
-                if (mCallbacks.get() != null) {
+                if (mCallbacks != null && mCallbacks.get() != null) {
                     LoaderThread oldThread = mLoaderThread;
                     if (oldThread != null) {
                         if (oldThread.isLaunching()) {
@@ -635,6 +635,10 @@ public class LauncherModel extends BroadcastReceiver {
                         return null;
                     }
 
+                    if (mCallbacks == null) {
+                        return null;
+                    }
+
                     final Callbacks callbacks = mCallbacks.get();
                     if (callbacks != oldCallbacks) {
                         return null;