diff options
author | Patrick Dubroy <dubroy@google.com> | 2011-03-07 13:38:54 -0800 |
---|---|---|
committer | Patrick Dubroy <dubroy@google.com> | 2011-03-07 13:44:26 -0800 |
commit | d1837cc69eb222371afdd30890f7215d117510f2 (patch) | |
tree | 008c9d80c01897e3de4b46bf1e94cf73815c84ad /src/com | |
parent | 320b2fb5eff8750d07dc9b4874c2ec0b92a601b8 (diff) | |
download | android_packages_apps_Trebuchet-d1837cc69eb222371afdd30890f7215d117510f2.tar.gz android_packages_apps_Trebuchet-d1837cc69eb222371afdd30890f7215d117510f2.tar.bz2 android_packages_apps_Trebuchet-d1837cc69eb222371afdd30890f7215d117510f2.zip |
Fix 4020235: NPE at com.android.launcher2.DragLayer.onInterceptTouchEvent
Change-Id: I606573f36270109b156b625b416d05ee16a44316
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/launcher2/DragLayer.java | 20 |
1 files changed, 11 insertions, 9 deletions
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); } |