Fix 2614384 - NPE in LauncherModel

Callbacks can be null.

Change-Id: I56462a54673b1804a6235d6d882008b453290542
This commit is contained in:
Joe Onorato 2010-04-21 17:09:18 -04:00
parent d65d08e709
commit 87d2ca8a66
1 changed files with 12 additions and 8 deletions

View File

@ -1103,15 +1103,19 @@ public class LauncherModel extends BroadcastReceiver {
public void run() {
final long t = SystemClock.uptimeMillis();
final Callbacks callbacks = tryGetCallbacks(oldCallbacks);
if (first) {
mBeforeFirstLoad = false;
callbacks.bindAllApplications(added);
if (callbacks != null) {
if (first) {
mBeforeFirstLoad = false;
callbacks.bindAllApplications(added);
} else {
callbacks.bindAppsAdded(added);
}
if (DEBUG_LOADERS) {
Log.d(TAG, "bound " + added.size() + " apps in "
+ (SystemClock.uptimeMillis() - t) + "ms");
}
} else {
callbacks.bindAppsAdded(added);
}
if (DEBUG_LOADERS) {
Log.d(TAG, "bound " + added.size() + " apps in "
+ (SystemClock.uptimeMillis() - t) + "ms");
Log.i(TAG, "not binding apps: no Launcher activity");
}
}
});