Fixing NullPointer Exception when user is deleted.

Bug: 18388507
Change-Id: I4176ea37a019c2a862e6b2875cc6b03ec9118571
This commit is contained in:
Sunny Goyal 2014-11-14 10:14:18 -08:00
parent e0f58d7364
commit 06910a8844
1 changed files with 3 additions and 0 deletions

View File

@ -388,6 +388,9 @@ public class InstallShortcutReceiver extends BroadcastReceiver {
// The is an internal launcher target shortcut. // The is an internal launcher target shortcut.
UserHandleCompat user = UserManagerCompat.getInstance(context) UserHandleCompat user = UserManagerCompat.getInstance(context)
.getUserForSerialNumber(object.getLong(USER_HANDLE_KEY)); .getUserForSerialNumber(object.getLong(USER_HANDLE_KEY));
if (user == null) {
return null;
}
LauncherActivityInfoCompat info = LauncherAppsCompat.getInstance(context) LauncherActivityInfoCompat info = LauncherAppsCompat.getInstance(context)
.resolveActivity(launcherIntent, user); .resolveActivity(launcherIntent, user);