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

Commit d1d4d43f authored by Amit Mahajan's avatar Amit Mahajan
Browse files

Add sanity check to avoid NullPointerException.

Test: none
Bug: 72463137
Change-Id: I6308d7495048dca751d8ad0d9974b3484fa527ae
parent e200adbf
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -384,7 +384,12 @@ public class SubscriptionInfoUpdater extends Handler {
        // removed or a refresh RESET that the IccRecords could be null. The right behavior is to
        // not broadcast the SIM loaded.
        int loadedSlotId = slotId;
        IccRecords records = mPhone[slotId].getIccCard().getIccRecords();
        IccCard iccCard = mPhone[slotId].getIccCard();
        if (iccCard == null) {  // Possibly a race condition.
            logd("handleSimLoaded: IccCard null");
            return;
        }
        IccRecords records = iccCard.getIccRecords();
        if (records == null) {  // Possibly a race condition.
            logd("handleSimLoaded: IccRecords null");
            return;