From 3290ec4cc220f97460b3b19f28adaf829ea971e1 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Mon, 4 May 2015 13:53:42 -0700 Subject: [PATCH] Preventing launcher crash because of invalid install shortcut intent Change-Id: Ibede31c8f018b17da5f272aa505a31f40a1b76f3 --- src/com/android/launcher3/InstallShortcutReceiver.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher3/InstallShortcutReceiver.java b/src/com/android/launcher3/InstallShortcutReceiver.java index 27dda6404a..23bcc8577c 100644 --- a/src/com/android/launcher3/InstallShortcutReceiver.java +++ b/src/com/android/launcher3/InstallShortcutReceiver.java @@ -146,10 +146,13 @@ public class InstallShortcutReceiver extends BroadcastReceiver { return; } - if (DBG) Log.d(TAG, "Got INSTALL_SHORTCUT: " + data.toUri(0)); PendingInstallShortcutInfo info = new PendingInstallShortcutInfo(data, context); - info = convertToLauncherActivityIfPossible(info); + if (info.launchIntent == null || info.label == null) { + if (DBG) Log.e(TAG, "Invalid install shortcut intent"); + return; + } + info = convertToLauncherActivityIfPossible(info); queuePendingShortcutInfo(info, context); }