aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2011-10-20 20:31:17 +0900
committerTadashi G. Takaoka <takaoka@google.com>2011-10-20 20:31:17 +0900
commit49426a1ea941c0331a6e573e36cff3c3a8e8849c (patch)
tree0d218de8fcad20e06143e6acb478ab6e996fd6ec /java
parent9f058749f2e8bf9194034d273535c960fe811161 (diff)
downloadlatinime-49426a1ea941c0331a6e573e36cff3c3a8e8849c.tar.gz
latinime-49426a1ea941c0331a6e573e36cff3c3a8e8849c.tar.xz
latinime-49426a1ea941c0331a6e573e36cff3c3a8e8849c.zip
Fix potential NPE
Bug: 5462524 Change-Id: I76012d1bbcd83d58f034c2f588802e4d1b7edc4d
Diffstat (limited to 'java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index d12708db9..24d599eb6 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -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))