From c1701ad4b2f7e8edf03438df26e1c2161d034847 Mon Sep 17 00:00:00 2001 From: Patrick Dubroy Date: Fri, 16 Jul 2010 15:43:04 -0700 Subject: Fix null pointer when dragging outside of workspace. --- src/com/android/launcher2/DragController.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/com/android/launcher2/DragController.java b/src/com/android/launcher2/DragController.java index f2fad9a08..0130ba93c 100644 --- a/src/com/android/launcher2/DragController.java +++ b/src/com/android/launcher2/DragController.java @@ -394,13 +394,14 @@ public class DragController { // Drop on someone? final int[] coordinates = mCoordinatesTemp; DropTarget dropTarget = findDropTarget(screenX, screenY, coordinates); - DropTarget delegate = dropTarget.getDropTargetDelegate( - mDragSource, coordinates[0], coordinates[1], - (int) mTouchOffsetX, (int) mTouchOffsetY, mDragView, mDragInfo); - if (delegate != null) { - dropTarget = delegate; - } if (dropTarget != null) { + DropTarget delegate = dropTarget.getDropTargetDelegate( + mDragSource, coordinates[0], coordinates[1], + (int) mTouchOffsetX, (int) mTouchOffsetY, mDragView, mDragInfo); + if (delegate != null) { + dropTarget = delegate; + } + if (mLastDropTarget == dropTarget) { dropTarget.onDragOver(mDragSource, coordinates[0], coordinates[1], (int) mTouchOffsetX, (int) mTouchOffsetY, mDragView, mDragInfo); -- cgit v1.2.3