Fix potential NPE

Bug: 5462524
Change-Id: I76012d1bbcd83d58f034c2f588802e4d1b7edc4d
This commit is contained in:
Tadashi G. Takaoka 2011-10-20 20:31:17 +09:00
parent 9f058749f2
commit 49426a1ea9

View file

@ -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))