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

Commit 7fe73bea authored by Matthew Sedam's avatar Matthew Sedam
Browse files

Fix NPE in ContextHubTransactionManager timeout future

mTimeoutFuture can be null if the transaction is completed before the timeout future is scheduled.

Bug: N/A
Change-Id: Id697ea9c5f3c0fea2bb111f8c57af42db9375b1d
Flag: EXEMPT bugfix
Test: Presubmits
parent be819304
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -522,7 +522,10 @@ import java.util.concurrent.atomic.AtomicInteger;
     * the caller has obtained a lock on this ContextHubTransactionManager object.
     */
    private void removeTransactionAndStartNext() {
        mTimeoutFuture.cancel(false /* mayInterruptIfRunning */);
        if (mTimeoutFuture != null) {
            mTimeoutFuture.cancel(/* mayInterruptIfRunning= */ false);
            mTimeoutFuture = null;
        }

        ContextHubServiceTransaction transaction = mTransactionQueue.remove();
        transaction.setComplete();