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

Commit 34ed4d4d authored by Siarhei Vishniakou's avatar Siarhei Vishniakou
Browse files

Ensure connection is non-null

The function getConnectionLocked can return null. We must check the
result for null to prevent dereferencing null.

Bug: 143459140
Test: none
Change-Id: I43991ea2ac9e23b5d5fc198a0ac8622d83696d31
parent c8f2d971
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -717,7 +717,7 @@ bool InputDispatcher::shouldPruneInboundQueueLocked(const MotionEntry& motionEnt
        for (TouchedMonitor& gestureMonitor : gestureMonitors) {
            sp<Connection> connection =
                    getConnectionLocked(gestureMonitor.monitor.inputChannel->getConnectionToken());
            if (connection->responsive) {
            if (connection != nullptr && connection->responsive) {
                // This monitor could take more input. Drop all events preceding this
                // event, so that gesture monitor could get a chance to receive the stream
                ALOGW("Pruning the input queue because %s is unresponsive, but we have a "