diff options
author | Jay Shrauner <shrauner@google.com> | 2014-10-24 15:57:37 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-10-24 15:57:37 +0000 |
commit | 2d06c9fd69c6321f827a00b69282be812f175fed (patch) | |
tree | 4158a666d4b64387e604565c63ad15a17aa018b7 | |
parent | 0ab79097ebbcb209b6cb07eef7bf2d011266992b (diff) | |
parent | 880298f31882cd2d4f57117672dca19081f13b8a (diff) |
am 880298f3: am 152266fb: Fix NPE in processNestedScroll
* commit '880298f31882cd2d4f57117672dca19081f13b8a':
Fix NPE in processNestedScroll
-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); |