Merge "Fix: NPE in isValidWord after dictionaries are closed."

This commit is contained in:
Keisuke Kuroyanagi 2014-03-27 03:12:07 +00:00 committed by Android (Google) Code Review
commit 3c38e1f269

View file

@ -480,6 +480,9 @@ public class DictionaryFacilitatorForSuggest {
return false; return false;
} }
final Dictionaries dictionaries = mDictionaries; final Dictionaries dictionaries = mDictionaries;
if (dictionaries.mLocale == null) {
return false;
}
final String lowerCasedWord = word.toLowerCase(dictionaries.mLocale); final String lowerCasedWord = word.toLowerCase(dictionaries.mLocale);
final Map<String, Dictionary> dictMap = dictionaries.mDictMap; final Map<String, Dictionary> dictMap = dictionaries.mDictMap;
for (final Dictionary dictionary : dictMap.values()) { for (final Dictionary dictionary : dictMap.values()) {