am 49426a1e: Fix potential NPE

* commit '49426a1ea941c0331a6e573e36cff3c3a8e8849c':
  Fix potential NPE
This commit is contained in:
Tadashi G. Takaoka 2011-10-20 07:08:03 -07:00 committed by Android Git Automerger
commit f8bd4c5c9d

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