am 9a0216de: Avoid NPE by checking
* commit '9a0216def936a368f87acef082318e99650c2c97': Avoid NPE by checkingmain
commit
29b9b39336
|
@ -71,6 +71,9 @@ public final class SettingsFragment extends InputMethodSettingsFragment
|
||||||
// Because the "%s" summary trick of {@link ListPreference} doesn't work properly before
|
// Because the "%s" summary trick of {@link ListPreference} doesn't work properly before
|
||||||
// KitKat, we need to update the summary programmatically.
|
// KitKat, we need to update the summary programmatically.
|
||||||
final ListPreference listPreference = (ListPreference)findPreference(prefKey);
|
final ListPreference listPreference = (ListPreference)findPreference(prefKey);
|
||||||
|
if (listPreference == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
final CharSequence entries[] = listPreference.getEntries();
|
final CharSequence entries[] = listPreference.getEntries();
|
||||||
final int entryIndex = listPreference.findIndexOfValue(listPreference.getValue());
|
final int entryIndex = listPreference.findIndexOfValue(listPreference.getValue());
|
||||||
listPreference.setSummary(entryIndex < 0 ? null : entries[entryIndex]);
|
listPreference.setSummary(entryIndex < 0 ? null : entries[entryIndex]);
|
||||||
|
|
Loading…
Reference in New Issue