am 9218c511: Fix: NPE in DistracterFilter

* commit '9218c5112995969325a8a900924d0cff49824184':
  Fix: NPE in DistracterFilter
main
Keisuke Kuroyanagi 2014-05-22 07:39:39 +00:00 committed by Android Git Automerger
commit c22f778435
1 changed files with 9 additions and 7 deletions

View File

@ -77,6 +77,7 @@ public class DistracterFilter {
public DistracterFilter(final Context context, final List<InputMethodSubtype> enabledSubtypes) {
mContext = context;
mLocaleToSubtypeMap = new HashMap<>();
if (enabledSubtypes != null) {
for (final InputMethodSubtype subtype : enabledSubtypes) {
final Locale locale = SubtypeLocaleUtils.getSubtypeLocale(subtype);
if (mLocaleToSubtypeMap.containsKey(locale)) {
@ -86,6 +87,7 @@ public class DistracterFilter {
}
mLocaleToSubtypeMap.put(locale, subtype);
}
}
mLocaleToKeyboardMap = new HashMap<>();
mSuggest = new Suggest();
mKeyboard = null;