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

Commit 5e7b91f2 authored by Brad Ebinger's avatar Brad Ebinger
Browse files

Add an NPE check to remove NPE during disconnect+cancel pending call

Fixes: 301205210
Flag: trivial npe check, no flag required
Test: atest TelecomUnitTests:CallsManagerTest
Change-Id: I079ad30c93d3d11de8d4695d0d461b874dd7193f
parent 0b0d7ad4
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -5533,9 +5533,10 @@ public class CallsManager extends Call.ListenerBase
            // We are going to place the new outgoing call, so disconnect any ongoing self-managed
            // calls which are ongoing at this time.
            disconnectSelfManagedCalls("outgoing call " + callId);

            if (mPendingCallConfirm != null) {
                mPendingCallConfirm.complete(mPendingCall);
                mPendingCallConfirm = null;
            }
            mPendingCall = null;
        }
    }
@@ -5554,10 +5555,12 @@ public class CallsManager extends Call.ListenerBase
            markCallAsDisconnected(mPendingCall, new DisconnectCause(DisconnectCause.CANCELED));
            markCallAsRemoved(mPendingCall);
            mPendingCall = null;
            if (mPendingCallConfirm != null) {
                mPendingCallConfirm.complete(null);
                mPendingCallConfirm = null;
            }
        }
    }

    /**
     * Called from {@link #startOutgoingCall(Uri, PhoneAccountHandle, Bundle, UserHandle, Intent, String)} when