Fix null pointer when dragging outside of workspace.

This commit is contained in:
Patrick Dubroy 2010-07-16 15:43:04 -07:00
parent 379f16080f
commit c1701ad4b2
1 changed files with 7 additions and 6 deletions

View File

@ -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);