am fd15686a: Merge "Fix an NPE"

* commit 'fd15686ae915d9a95f1b6d52b1fc720bf745d77c':
  Fix an NPE
main
Jean Chalard 2013-04-15 21:15:50 -07:00 committed by Android Git Automerger
commit 8e5c6d7090
1 changed files with 1 additions and 0 deletions

View File

@ -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<SuggestedWordInfo> suggestions = CollectionUtils.newArrayList();
final String typedWord = range.mWord.toString();
if (range.mWord instanceof SpannableString) {