From 39511301a29f1965155e848c214dfa4bc3530722 Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Mon, 7 Oct 2013 17:08:23 -0700 Subject: [PATCH] Fix crash in crop view Bug: 11120454 --- src/com/android/launcher3/CropView.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/com/android/launcher3/CropView.java b/src/com/android/launcher3/CropView.java index f68f739d70..c8b974d01b 100644 --- a/src/com/android/launcher3/CropView.java +++ b/src/com/android/launcher3/CropView.java @@ -197,13 +197,14 @@ public class CropView extends TiledImageView implements OnScaleGestureListener { float squaredDist = (mFirstX - x) * (mFirstX - x) + (mFirstY - y) * (mFirstY - y); float slop = config.getScaledTouchSlop() * config.getScaledTouchSlop(); long now = System.currentTimeMillis(); - // only do this if it's a small movement - if (mTouchCallback != null && - squaredDist < slop && - now < mTouchDownTime + ViewConfiguration.getTapTimeout()) { - mTouchCallback.onTap(); + if (mTouchCallback != null) { + // only do this if it's a small movement + if (squaredDist < slop && + now < mTouchDownTime + ViewConfiguration.getTapTimeout()) { + mTouchCallback.onTap(); + } + mTouchCallback.onTouchUp(); } - mTouchCallback.onTouchUp(); } if (!mTouchEnabled) {