summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2012-06-18 10:33:21 -0700
committerMichael Jurka <mikejurka@google.com>2012-06-18 10:40:03 -0700
commit5649c287039ea7908112b41604c3fc2893c4697e (patch)
tree4967905cea142ea165177bdae454776c74b68298
parenta35a7807c27641187e6de5dee8dcd405b683e294 (diff)
downloadandroid_packages_apps_Trebuchet-5649c287039ea7908112b41604c3fc2893c4697e.tar.gz
android_packages_apps_Trebuchet-5649c287039ea7908112b41604c3fc2893c4697e.tar.bz2
android_packages_apps_Trebuchet-5649c287039ea7908112b41604c3fc2893c4697e.zip
Add null pointer checks to fix NPEs
Bug: 6611233 Bug: 6685401 Change-Id: I804dfe0a7ad36b43168f7384ef88459d765fff6b
-rw-r--r--src/com/android/launcher2/Folder.java4
-rw-r--r--src/com/android/launcher2/InstallShortcutReceiver.java1
2 files changed, 4 insertions, 1 deletions
diff --git a/src/com/android/launcher2/Folder.java b/src/com/android/launcher2/Folder.java
index 1163f9ec4..de2e4359a 100644
--- a/src/com/android/launcher2/Folder.java
+++ b/src/com/android/launcher2/Folder.java
@@ -923,7 +923,9 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
private void onCloseComplete() {
DragLayer parent = (DragLayer) getParent();
- parent.removeView(this);
+ if (parent != null) {
+ parent.removeView(this);
+ }
mDragController.removeDropTarget((DropTarget) this);
clearFocus();
mFolderIcon.requestFocus();
diff --git a/src/com/android/launcher2/InstallShortcutReceiver.java b/src/com/android/launcher2/InstallShortcutReceiver.java
index 54ba7de18..a525d00ee 100644
--- a/src/com/android/launcher2/InstallShortcutReceiver.java
+++ b/src/com/android/launcher2/InstallShortcutReceiver.java
@@ -169,6 +169,7 @@ public class InstallShortcutReceiver extends BroadcastReceiver {
if (intent.getAction() == null) {
intent.setAction(Intent.ACTION_VIEW);
} else if (intent.getAction().equals(Intent.ACTION_MAIN) &&
+ intent.getCategories() != null &&
intent.getCategories().contains(Intent.CATEGORY_LAUNCHER)) {
intent.addFlags(
Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);