Fix possible NPE in Launcher.

This commit is contained in:
Romain Guy authored and Joe Onorato committed 2009-09-21 15:12:31 -04:00
1 parent eb486df097
commit d94533d04a
1 file changed
+9 -7
+9 -7
View File
@@ -602,13 +602,15 @@ public class CellLayout extends ViewGroup {
* @param targetXY Destination area to move to
*/
void onDropChild(View child, int[] targetXY) {
LayoutParams lp = (LayoutParams) child.getLayoutParams();
lp.cellX = targetXY[0];
lp.cellY = targetXY[1];
lp.isDragging = false;
mDragRect.setEmpty();
child.requestLayout();
invalidate();
if (child != null) {
LayoutParams lp = (LayoutParams) child.getLayoutParams();
lp.cellX = targetXY[0];
lp.cellY = targetXY[1];
lp.isDragging = false;
mDragRect.setEmpty();
child.requestLayout();
invalidate();
}
}
void onDropAborted(View child) {