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

Commit a3ba1831 authored by Zoey Chen's avatar Zoey Chen
Browse files

[Settings] Add NPE protection for the bundle

Bug: 238980691
Change-Id: I0f5e79ab83701552bc92b07ebdc0ee90b700721f
Test: atest EnabledNetworkModePreferenceControllerTest
parent 501cc983
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -239,8 +239,8 @@ public class EnabledNetworkModePreferenceController extends
        void setPreferenceEntries() {
            mTelephonyManager = mTelephonyManager.createForSubscriptionId(mSubId);
            final PersistableBundle carrierConfig = mCarrierConfigCache.getConfigForSubId(mSubId);
            final boolean display2gOptions = carrierConfig
                    .getBoolean(CarrierConfigManager.KEY_PREFER_2G_BOOL);
            final boolean display2gOptions = carrierConfig != null
                    && carrierConfig.getBoolean(CarrierConfigManager.KEY_PREFER_2G_BOOL);
            clearAllEntries();
            UiOptions.Builder uiOptions = UiOptions.newBuilder();
            uiOptions.setType(getEnabledNetworkType());