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

Commit 75c6ddf3 authored by satok's avatar satok Committed by Android (Google) Code Review
Browse files

Merge "Fix NPE in getLastInputMethodSubtype"

parents 3eeb1a98 0e7d7d63
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1623,8 +1623,11 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
            if (lastImi == null) return null;
            try {
                final int lastSubtypeHash = Integer.valueOf(lastIme.second);
                return lastImi.getSubtypeAt(getSubtypeIdFromHashCode(
                        lastImi, lastSubtypeHash));
                final int lastSubtypeId = getSubtypeIdFromHashCode(lastImi, lastSubtypeHash);
                if (lastSubtypeId < 0 || lastSubtypeId >= lastImi.getSubtypeCount()) {
                    return null;
                }
                return lastImi.getSubtypeAt(lastSubtypeId);
            } catch (NumberFormatException e) {
                return null;
            }