Fix NPE in DeviceInfoSettings
Bug 7192187 Change-Id: I6d404e5228c7f66e37137a27ebd555a88dda2f74
This commit is contained in:
@@ -175,7 +175,10 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment {
|
|||||||
|
|
||||||
private void removePreferenceIfBoolFalse(String preference, int resId) {
|
private void removePreferenceIfBoolFalse(String preference, int resId) {
|
||||||
if (!getResources().getBoolean(resId)) {
|
if (!getResources().getBoolean(resId)) {
|
||||||
getPreferenceScreen().removePreference(findPreference(preference));
|
Preference pref = findPreference(preference);
|
||||||
|
if (pref != null) {
|
||||||
|
getPreferenceScreen().removePreference(pref);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user