summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlamefire <alex@grundis.de>2014-04-21 17:58:55 +0200
committerSteve Kondik <shade@chemlab.org>2014-05-03 22:16:14 +0000
commitd027815092005de1a63d24ab0c06ea0f982b9843 (patch)
tree588fad494bc00c3a10c2ea9f0be74ad931bb0b96
parent7e0e4fa1b8eb64f71893005f521fc9a27f421944 (diff)
downloadandroid_packages_apps_Trebuchet-d027815092005de1a63d24ab0c06ea0f982b9843.tar.gz
android_packages_apps_Trebuchet-d027815092005de1a63d24ab0c06ea0f982b9843.tar.bz2
android_packages_apps_Trebuchet-d027815092005de1a63d24ab0c06ea0f982b9843.zip
Fix NPE if a moved cell does not have a parent
This NPE should actually never happen. It did however and crashed Trebuchet. Symptom that will lead to this NPE: Drag Shortcut from homescreen to somewhere else. Old icon will not get removed while dragging. This should also be fixed! Change-Id: I5b5070c93077e69f0f63a26d337fb9aee83ec6d2
-rw-r--r--src/com/android/launcher3/Workspace.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 83074aeda..376ebb483 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -2878,7 +2878,9 @@ public class Workspace extends SmoothPagedView
final ItemInfo info = (ItemInfo) cell.getTag();
if (hasMovedLayouts) {
// Reparent the view
- getParentCellLayoutForView(cell).removeView(cell);
+ CellLayout parent = getParentCellLayoutForView(cell);
+ if (parent != null)
+ parent.removeView(cell);
addInScreen(cell, container, screenId, mTargetCell[0], mTargetCell[1],
info.spanX, info.spanY);
}