diff options
author | 2013-09-20 07:19:58 +0000 | |
---|---|---|
committer | 2013-09-20 07:19:59 +0000 | |
commit | 1d1a3d52b8f12766c7d2c1f2033217fce502f49a (patch) | |
tree | 9e9cbce83ec9a66b214d01e0c427c4391a01dd92 /java/src/com/android/inputmethod/latin/RichInputConnection.java | |
parent | baa3121704c4be8d883e58865fa643883a114b6b (diff) | |
parent | 8f02f1a118d36a1c4143b62f7e20727b2d2bf363 (diff) | |
download | latinime-1d1a3d52b8f12766c7d2c1f2033217fce502f49a.tar.gz latinime-1d1a3d52b8f12766c7d2c1f2033217fce502f49a.tar.xz latinime-1d1a3d52b8f12766c7d2c1f2033217fce502f49a.zip |
Merge "Fix a bug where null would be converted to "null""
Diffstat (limited to 'java/src/com/android/inputmethod/latin/RichInputConnection.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/RichInputConnection.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/RichInputConnection.java b/java/src/com/android/inputmethod/latin/RichInputConnection.java index a031bb3be..2ecf1463f 100644 --- a/java/src/com/android/inputmethod/latin/RichInputConnection.java +++ b/java/src/com/android/inputmethod/latin/RichInputConnection.java @@ -233,8 +233,10 @@ public final class RichInputConnection { // getCapsMode should be updated to be able to return a "not enough info" result so that // we can get more context only when needed. if (TextUtils.isEmpty(mCommittedTextBeforeComposingText) && 0 != mExpectedCursorPosition) { - mCommittedTextBeforeComposingText.append( - getTextBeforeCursor(DEFAULT_TEXT_CACHE_SIZE, 0)); + final CharSequence textBeforeCursor = getTextBeforeCursor(DEFAULT_TEXT_CACHE_SIZE, 0); + if (!TextUtils.isEmpty(textBeforeCursor)) { + mCommittedTextBeforeComposingText.append(textBeforeCursor); + } } // This never calls InputConnection#getCapsMode - in fact, it's a static method that // never blocks or initiates IPC. |