From 0f6b4eb9aef14224acea878799c7207b4e3aafed Mon Sep 17 00:00:00 2001 From: Danesh Mondegarian Date: Tue, 1 Apr 2014 21:16:39 -0700 Subject: Trebuchet : Check if target is null for cancelled events If a drag is cancelled on the workspace, ensure not to reference it in onDropCompleted since it will be null as per what DragController passes in. Reproduction steps : Long press a hotseat icon While dragging it, turn off screen. Change-Id: If587e7c9c37ea2e24b7f9cc85db8249ab34dd19f --- src/com/android/launcher3/Workspace.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index c99a0a51a..43994d702 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -3960,7 +3960,7 @@ public class Workspace extends SmoothPagedView // be done post drop animation. stripEmptyScreens(); } - } else if (mDragInfo != null && (!(target instanceof InfoDropTarget))) { + } else if (mDragInfo != null && target != null && (!(target instanceof InfoDropTarget))) { CellLayout cellLayout; if (mLauncher.isHotseatLayout(target)) { cellLayout = mLauncher.getHotseat().getLayout(); -- cgit v1.2.3