From 2b42ad0eaa5398853fd7d87a2580226d784a55eb Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Tue, 16 Apr 2013 12:20:10 +0900 Subject: [PATCH] Fix an NPE Bug: 8620678 Change-Id: Ia91761f33518a010b2844d34523cadece261c67e --- java/src/com/android/inputmethod/latin/LatinIME.java | 1 + 1 file changed, 1 insertion(+) diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 4db0a906e..bd3acab92 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -2413,6 +2413,7 @@ public final class LatinIME extends InputMethodService implements KeyboardAction if (!mConnection.isCursorTouchingWord(mSettings.getCurrent())) return; final Range range = mConnection.getWordRangeAtCursor(mSettings.getWordSeparators(), 0 /* additionalPrecedingWordsCount */); + if (null == range) return; // Happens if we don't have an input connection at all final ArrayList suggestions = CollectionUtils.newArrayList(); final String typedWord = range.mWord.toString(); if (range.mWord instanceof SpannableString) {