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

Commit 282b67b1 authored by tom hsu's avatar tom hsu
Browse files

[Settings] Prevent NPE from getting MobileIconGroup instance.

Bug: 187812523
Test: Maunal test.
Change-Id: Ief06c683c1c8a99d4ce2765cd802be221e55820e
parent d60eae55
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -603,7 +603,11 @@ public class SubscriptionsPreferenceController extends AbstractPreferenceControl
        public String getNetworkType(Context context, Config config,
                TelephonyDisplayInfo telephonyDisplayInfo, int subId) {
            String iconKey = getIconKey(telephonyDisplayInfo);
            int resId = mapIconSets(config).get(iconKey).dataContentDescription;
            MobileIconGroup iconGroup = mapIconSets(config).get(iconKey);
            int resId = 0;
            if (iconGroup != null) {
                resId = iconGroup.dataContentDescription;
            }
            return resId != 0
                    ? SubscriptionManager.getResourcesForSubId(context, subId).getString(resId)
                    : "";