diff options
author | Jay Shrauner <shrauner@google.com> | 2014-10-24 08:37:12 -0700 |
---|---|---|
committer | Jay Shrauner <shrauner@google.com> | 2014-10-24 08:41:41 -0700 |
commit | 152266fb7ae309942e9a67419f104a29f491c0b8 (patch) | |
tree | bfd2b9ad5aa56af114387dce67bc2aaee56dc51a /src/com | |
parent | c311af1f33f9d408c7eee5a6eeda46f1d1b7265b (diff) |
Fix NPE in processNestedScroll
Null check mCapturedView.
Bug:18114408
Change-Id: I5abb9f5bcca37aafab55f12c69d824ab92faf68f
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/dialer/widget/ViewDragHelper.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/com/android/dialer/widget/ViewDragHelper.java b/src/com/android/dialer/widget/ViewDragHelper.java index a0e1d801b..c0bc2ce29 100644 --- a/src/com/android/dialer/widget/ViewDragHelper.java +++ b/src/com/android/dialer/widget/ViewDragHelper.java @@ -1548,6 +1548,12 @@ public class ViewDragHelper { * deltas that it consumed. */ public void processNestedScroll(View target, int dx, int dy, int[] consumed) { + if (mCapturedView == null) { + // This is safe because consumed array is null when called from + // onNestedScroll, and pre-initialized to {0, 0} when called from + // onNestedPreScroll. + return; + } final int targetX = mCapturedView.getLeft() + dx; final int targetY = mCapturedView.getTop() + dy; dragTo(targetX, targetY, dx, dy); |