summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2012-06-18 21:40:20 (GMT)
committerAndroid Git Automerger <android-git-automerger@android.com>2012-06-18 21:40:20 (GMT)
commit2561ee8453dc41a9d65f7890ea227416d7e8948c (patch)
tree1cfb394d6928dc2d9f9770188aa716b14eadc9f4
parent8ef6618d5e767441846f8865c812e8ff6e961ef2 (diff)
parentd74389d9027a128da85be151670ee43e55feaba5 (diff)
downloadandroid_packages_apps_Trebuchet-2561ee8453dc41a9d65f7890ea227416d7e8948c.zip
android_packages_apps_Trebuchet-2561ee8453dc41a9d65f7890ea227416d7e8948c.tar.gz
android_packages_apps_Trebuchet-2561ee8453dc41a9d65f7890ea227416d7e8948c.tar.bz2
am d74389d9: Merge "Add null pointer checks to fix NPEs" into jb-dev
* commit 'd74389d9027a128da85be151670ee43e55feaba5': Add null pointer checks to fix NPEs
-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 1163f9e..de2e435 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 54ba7de..a525d00 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);