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

Commit 619b3c0d authored by Santos Cordon's avatar Santos Cordon
Browse files

Fix NPE in onDestroy.

NPE can happen when calls are canceled immediately before incallservice
has a chance to respond.

Bug:17362107
Change-Id: I6bf318f5f7d89731b686a1523678a26764fa9bf3
parent 1611c21d
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -165,11 +165,13 @@ public abstract class InCallService extends Service {

    @Override
    public boolean onUnbind(Intent intent) {
        if (mPhone != null) {
            Phone oldPhone = mPhone;
            mPhone = null;

            oldPhone.destroy();
            onPhoneDestroyed(oldPhone);
        }
        return false;
    }