am 9218c511: Fix: NPE in DistracterFilter
* commit '9218c5112995969325a8a900924d0cff49824184': Fix: NPE in DistracterFiltermain
commit
c22f778435
|
@ -77,14 +77,16 @@ public class DistracterFilter {
|
|||
public DistracterFilter(final Context context, final List<InputMethodSubtype> enabledSubtypes) {
|
||||
mContext = context;
|
||||
mLocaleToSubtypeMap = new HashMap<>();
|
||||
for (final InputMethodSubtype subtype : enabledSubtypes) {
|
||||
final Locale locale = SubtypeLocaleUtils.getSubtypeLocale(subtype);
|
||||
if (mLocaleToSubtypeMap.containsKey(locale)) {
|
||||
// Multiple subtypes are enabled for one locale.
|
||||
// TODO: Investigate what we should do for this case.
|
||||
continue;
|
||||
if (enabledSubtypes != null) {
|
||||
for (final InputMethodSubtype subtype : enabledSubtypes) {
|
||||
final Locale locale = SubtypeLocaleUtils.getSubtypeLocale(subtype);
|
||||
if (mLocaleToSubtypeMap.containsKey(locale)) {
|
||||
// Multiple subtypes are enabled for one locale.
|
||||
// TODO: Investigate what we should do for this case.
|
||||
continue;
|
||||
}
|
||||
mLocaleToSubtypeMap.put(locale, subtype);
|
||||
}
|
||||
mLocaleToSubtypeMap.put(locale, subtype);
|
||||
}
|
||||
mLocaleToKeyboardMap = new HashMap<>();
|
||||
mSuggest = new Suggest();
|
||||
|
|
Loading…
Reference in New Issue