OSDN Git Service

Fix NPE in Workspace
authorAdam Cohen <adamcohen@google.com>
Wed, 17 Sep 2014 23:46:55 +0000 (16:46 -0700)
committerAdam Cohen <adamcohen@google.com>
Wed, 17 Sep 2014 23:47:08 +0000 (16:47 -0700)
Bug: 17503479
Change-Id: Ib20dfd67c5a755cd4b684163bb538a1bf77fa6ca

src/com/android/launcher3/Workspace.java

index 909cf5f..051b0c0 100644 (file)
@@ -1107,7 +1107,7 @@ public class Workspace extends SmoothPagedView
         case MotionEvent.ACTION_UP:
             if (mTouchState == TOUCH_STATE_REST) {
                 final CellLayout currentPage = (CellLayout) getChildAt(mCurrentPage);
-                if (!currentPage.lastDownOnOccupiedCell()) {
+                if (currentPage != null && !currentPage.lastDownOnOccupiedCell()) {
                     onWallpaperTap(ev);
                 }
             }