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

Commit 2f1cd7e6 authored by Michael Wright's avatar Michael Wright
Browse files

Fix possible NPE in PointerLocationView

Change-Id: I36577d6882db898ff4d4d9090454cdf71a440fd5
parent 0497a303
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -549,8 +549,9 @@ public class PointerLocationView extends View implements InputDeviceListener {

            final PointerState ps = mPointers.get(id);
            ps.mCurDown = true;
            ps.mHasBoundingBox = (InputDevice.getDevice(event.getDeviceId()).
                    getMotionRange(MotionEvent.AXIS_GENERIC_1) != null);
            InputDevice device = InputDevice.getDevice(event.getDeviceId());
            ps.mHasBoundingBox = device != null &&
                    device.getMotionRange(MotionEvent.AXIS_GENERIC_1) != null;
        }

        final int NI = event.getPointerCount();