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

Commit 8a0319ac authored by Makoto Onuki's avatar Makoto Onuki
Browse files

Fix WTF in PendingIntentRecord.unregisterCancelListenerLocked()

It's possible that detachCancelListenersLocked() has just been called
when unregisterCancelListenerLocked() is called, so need a null check.

Change-Id: If4b18d713595b1cf1a29ba05a3736892b21931a4
Fixes: 78592185
Test: build
parent 5d8dfe17
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -219,6 +219,9 @@ final class PendingIntentRecord extends IIntentSender.Stub {
    }

    public void unregisterCancelListenerLocked(IResultReceiver receiver) {
        if (mCancelCallbacks == null) {
            return; // Already unregistered or detached.
        }
        mCancelCallbacks.unregister(receiver);
        if (mCancelCallbacks.getRegisteredCallbackCount() <= 0) {
            mCancelCallbacks = null;