From ad56a9ac51a4dfb330b6a5f7ade78bd426b6716e Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Fri, 2 Sep 2011 15:35:23 +0900 Subject: [PATCH] Fix an NPE in settings Change-Id: I264c001a9cc28f864ad024fcf51fb42e9c203d3f --- java/src/com/android/inputmethod/latin/Settings.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/Settings.java b/java/src/com/android/inputmethod/latin/Settings.java index 1e2ef4824..db8ca3490 100644 --- a/java/src/com/android/inputmethod/latin/Settings.java +++ b/java/src/com/android/inputmethod/latin/Settings.java @@ -426,8 +426,10 @@ public class Settings extends InputMethodSettingsActivity final boolean showBigramSuggestionsOption = res.getBoolean( R.bool.config_enable_bigram_suggestions_option); if (!showBigramSuggestionsOption) { - textCorrectionGroup.removePreference(findPreference(PREF_BIGRAM_SUGGESTIONS)); - textCorrectionGroup.removePreference(findPreference(PREF_BIGRAM_PREDICTIONS)); + textCorrectionGroup.removePreference(mBigramSuggestion); + if (null != mBigramPrediction) { + textCorrectionGroup.removePreference(mBigramPrediction); + } } final boolean showUsabilityModeStudyOption = res.getBoolean(