From d1837cc69eb222371afdd30890f7215d117510f2 Mon Sep 17 00:00:00 2001 From: Patrick Dubroy Date: Mon, 7 Mar 2011 13:38:54 -0800 Subject: Fix 4020235: NPE at com.android.launcher2.DragLayer.onInterceptTouchEvent Change-Id: I606573f36270109b156b625b416d05ee16a44316 --- src/com/android/launcher2/DragLayer.java | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'src/com/android/launcher2') diff --git a/src/com/android/launcher2/DragLayer.java b/src/com/android/launcher2/DragLayer.java index 2e72f6223..eb539450f 100644 --- a/src/com/android/launcher2/DragLayer.java +++ b/src/com/android/launcher2/DragLayer.java @@ -62,17 +62,19 @@ public class DragLayer extends FrameLayout { // event has occurred which doesn't result in resizing a widget. In this case, we // dismiss any visible resize frames. final Workspace w = (Workspace) findViewById(R.id.workspace); - final CellLayout currentPage = (CellLayout) w.getChildAt(w.getCurrentPage()); - final CellLayoutChildren childrenLayout = currentPage.getChildrenLayout(); + if (w != null) { + final CellLayout currentPage = (CellLayout) w.getChildAt(w.getCurrentPage()); + final CellLayoutChildren childrenLayout = currentPage.getChildrenLayout(); - if (childrenLayout.hasResizeFrames() && !childrenLayout.isWidgetBeingResized()) { - post(new Runnable() { - public void run() { - if (!childrenLayout.isWidgetBeingResized()) { - childrenLayout.clearAllResizeFrames(); + if (childrenLayout.hasResizeFrames() && !childrenLayout.isWidgetBeingResized()) { + post(new Runnable() { + public void run() { + if (!childrenLayout.isWidgetBeingResized()) { + childrenLayout.clearAllResizeFrames(); + } } - } - }); + }); + } } return mDragController.onInterceptTouchEvent(ev); } -- cgit v1.2.3