aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-10-14 02:51:15 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-10-14 02:51:16 +0000
commit9959140f15edcb32c21406e3cff80ad6856e83c9 (patch)
treeb24c565056f78d6934e37ee6b5bacde57e498d2f /java/src
parentcbd59e02a97dac53ec97f59c1a638bc421ba4a52 (diff)
parent7d74594123bd9ee3a09f54d509bff27af5f6cca8 (diff)
downloadlatinime-9959140f15edcb32c21406e3cff80ad6856e83c9.tar.gz
latinime-9959140f15edcb32c21406e3cff80ad6856e83c9.tar.xz
latinime-9959140f15edcb32c21406e3cff80ad6856e83c9.zip
Merge "Fix an NPE."
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/RichInputConnection.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/RichInputConnection.java b/java/src/com/android/inputmethod/latin/RichInputConnection.java
index 62a258b20..a3f7bb4d6 100644
--- a/java/src/com/android/inputmethod/latin/RichInputConnection.java
+++ b/java/src/com/android/inputmethod/latin/RichInputConnection.java
@@ -860,9 +860,10 @@ public final class RichInputConnection implements PrivateCommandPerformer {
* than it really is.
*/
public void tryFixLyingCursorPosition() {
+ mIC = mParent.getCurrentInputConnection();
final CharSequence textBeforeCursor = getTextBeforeCursor(
Constants.EDITOR_CONTENTS_CACHE_SIZE, 0);
- final CharSequence selectedText = mIC.getSelectedText(0 /* flags */);
+ final CharSequence selectedText = null == mIC ? null : mIC.getSelectedText(0 /* flags */);
if (null == textBeforeCursor ||
(!TextUtils.isEmpty(selectedText) && mExpectedSelEnd == mExpectedSelStart)) {
// If textBeforeCursor is null, we have no idea what kind of text field we have or if