From 2f32ad29075bf666199cc49fe20014e00991d1bb Mon Sep 17 00:00:00 2001 From: Adam Cohen Date: Wed, 13 Nov 2013 11:29:49 +0000 Subject: [PATCH] Add logging for NPE (issue 11627249) Change-Id: I75352f9eb1249fa5cc46d05cd7c168a868c6f7b7 --- src/com/android/launcher3/Workspace.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index f36c815da5..6c346c4b76 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -2536,6 +2536,13 @@ public class Workspace extends SmoothPagedView icon.clearPressedOrFocusedBackground(); } + if (child.getTag() == null || !(child.getTag() instanceof ItemInfo)) { + String msg = "Drag started with a view that has no tag set. This " + + "will cause a crash (issue 11627249) down the line. " + + "View: " + child + " tag: " + child.getTag(); + throw new IllegalStateException(msg); + } + mDragController.startDrag(b, dragLayerX, dragLayerY, source, child.getTag(), DragController.DRAG_ACTION_MOVE, dragVisualizeOffset, dragRect, scale);