am 0bce702c: am 185ba407: Fix NPE in DeviceInfoSettings

* commit '0bce702c5f1ea9369f85a1375e8dbc3cad540368':
  Fix NPE in DeviceInfoSettings
This commit is contained in:
Brian Muramatsu
2012-09-19 15:21:23 -07:00
committed by Android Git Automerger

View File

@@ -175,7 +175,10 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment {
private void removePreferenceIfBoolFalse(String preference, int resId) {
if (!getResources().getBoolean(resId)) {
getPreferenceScreen().removePreference(findPreference(preference));
Preference pref = findPreference(preference);
if (pref != null) {
getPreferenceScreen().removePreference(pref);
}
}
}