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

Commit 49426a1e authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka
Browse files

Fix potential NPE

Bug: 5462524
Change-Id: I76012d1bbcd83d58f034c2f588802e4d1b7edc4d
parent 9f058749
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1814,8 +1814,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
            final int rawPrimaryCode = suggestion.charAt(0);
            // Maybe apply the "bidi mirrored" conversions for parentheses
            final LatinKeyboard keyboard = mKeyboardSwitcher.getLatinKeyboard();
            final int primaryCode = Key.getRtlParenthesisCode(
                    rawPrimaryCode, keyboard.mIsRtlKeyboard);
            final boolean isRtl = keyboard != null && keyboard.mIsRtlKeyboard;
            final int primaryCode = Key.getRtlParenthesisCode(rawPrimaryCode, isRtl);

            final CharSequence beforeText = ic != null ? ic.getTextBeforeCursor(1, 0) : "";
            final int toLeft = (ic == null || TextUtils.isEmpty(beforeText))