Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9218c511 authored by Keisuke Kuroyanagi's avatar Keisuke Kuroyanagi
Browse files

Fix: NPE in DistracterFilter

Change-Id: I19a92d79cf547aae8f15e7e5fd5309812ae4f2d5
parent 5e2c4c02
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
@@ -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;