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

Commit 481b3abe authored by Stanley Wang's avatar Stanley Wang
Browse files

Fix NPE in SettingsMainSwitchPreference.

- Check if the RestrictedPreferenceHelper is null to avoid NPE.

Fix: 190135868
Test: run robotest and manually test that page.
Change-Id: I746099260d8f53dc30513ccbb30aec5cbe3657e7
parent 367fe0ea
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -84,7 +84,9 @@ public class SettingsMainSwitchPreference extends TwoStatePreference implements

        mMainSwitchBar = (SettingsMainSwitchBar) holder.findViewById(R.id.main_switch_bar);
        mMainSwitchBar.show();
        if (mRestrictedHelper != null) {
            mEnforcedAdmin = mRestrictedHelper.checkRestrictionEnforced();
        }
        updateStatus(isChecked());
        registerListenerToSwitchBar();