Fix the NullPointException

The subscriptionInfo.getCarrierName may be a null, so adding the null
checking.

Bug: 236064286
Test: build pass
Change-Id: I8f6f5ac725d6dd552ac2626725e44f52dcbf6c32
This commit is contained in:
SongFerngWang
2022-06-16 09:59:16 +08:00
parent 73276b3c91
commit 5a4df243f0
2 changed files with 5 additions and 3 deletions

View File

@@ -201,7 +201,8 @@ public class ResetNetwork extends InstrumentedFragment {
name = record.getNumber();
}
if (TextUtils.isEmpty(name)) {
name = record.getCarrierName().toString();
CharSequence carrierName = record.getCarrierName();
name = TextUtils.isEmpty(carrierName) ? "" : carrierName.toString();
}
if (TextUtils.isEmpty(name)) {
name = String.format("MCC:%s MNC:%s Slot:%s Id:%s", record.getMcc(),