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

Commit 4236ad7a authored by Andreas Gampe's avatar Andreas Gampe
Browse files

Frameworks/base: Fix potential NPE in InputMethod

Don't read the size of an unchecked list.

Bug: 19797138
Change-Id: I9d8c087aff7bc9cc1e8aae9a0b489e23b5442765
parent 28e6aeca
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1993,8 +1993,8 @@ public final class InputMethodManager {
                List<Object> info = mService.getShortcutInputMethodsAndSubtypes();
                // "info" has imi1, subtype1, subtype2, imi2, subtype2, imi3, subtype3..in the list
                ArrayList<InputMethodSubtype> subtypes = null;
                if (info != null && !info.isEmpty()) {
                    final int N = info.size();
                if (info != null && N > 0) {
                    for (int i = 0; i < N; ++i) {
                        Object o = info.get(i);
                        if (o instanceof InputMethodInfo) {