From 21ce2d8caeda3c9eb762a2129d37c384de718941 Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Fri, 2 Sep 2011 15:28:06 -0700 Subject: Fix a NPE in Recents Change-Id: I8fead3b20646e92add6acd49440db675a190baee --- packages/SystemUI/src/com/android/systemui/SwipeHelper.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java index 14743f48aa74..09d38d8a27c3 100644 --- a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java +++ b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java @@ -165,11 +165,13 @@ public class SwipeHelper { case MotionEvent.ACTION_DOWN: mDragging = false; mCurrView = mCallback.getChildAtPosition(ev); - mCurrAnimView = mCallback.getChildContentView(mCurrView); - mCanCurrViewBeDimissed = mCallback.canChildBeDismissed(mCurrView); mVelocityTracker.clear(); - mVelocityTracker.addMovement(ev); - mInitialTouchPos = getPos(ev); + if (mCurrView != null) { + mCurrAnimView = mCallback.getChildContentView(mCurrView); + mCanCurrViewBeDimissed = mCallback.canChildBeDismissed(mCurrView); + mVelocityTracker.addMovement(ev); + mInitialTouchPos = getPos(ev); + } break; case MotionEvent.ACTION_MOVE: if (mCurrView != null) { -- cgit v1.2.3-59-g8ed1b