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
This commit is contained in:
@@ -84,7 +84,9 @@ public class SettingsMainSwitchPreference extends TwoStatePreference implements
|
||||
|
||||
mMainSwitchBar = (SettingsMainSwitchBar) holder.findViewById(R.id.main_switch_bar);
|
||||
mMainSwitchBar.show();
|
||||
mEnforcedAdmin = mRestrictedHelper.checkRestrictionEnforced();
|
||||
if (mRestrictedHelper != null) {
|
||||
mEnforcedAdmin = mRestrictedHelper.checkRestrictionEnforced();
|
||||
}
|
||||
updateStatus(isChecked());
|
||||
registerListenerToSwitchBar();
|
||||
|
||||
|
Reference in New Issue
Block a user