Skip to content
Snippets Groups Projects
Commit 9218c511 authored by Keisuke Kuroyanagi's avatar Keisuke Kuroyanagi
Browse files

Fix: NPE in DistracterFilter

Change-Id: I19a92d79cf547aae8f15e7e5fd5309812ae4f2d5
parent 5e2c4c02
No related branches found
No related tags found
No related merge requests found
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment