Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 14b8578b authored by Jay Shrauner's avatar Jay Shrauner Committed by Divya Sharma
Browse files

Fix NPE in processNestedScroll

Null check mCapturedView.

Bug:18114408
Change-Id: Ia70428fda52e6ca217b17ce3a661b272ca50518a
parent 5b4258ad
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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);