diff options
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 494846b04..69a4fa63c 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1913,6 +1913,10 @@ public final class LatinIME extends InputMethodService implements KeyboardAction } private SuggestedWords getSuggestedWords(final int sessionId) { + final Keyboard keyboard = mKeyboardSwitcher.getKeyboard(); + if (keyboard == null) { + return SuggestedWords.EMPTY; + } final String typedWord = mWordComposer.getTypedWord(); // Get the word on which we should search the bigrams. If we are composing a word, it's // whatever is *before* the half-committed word in the buffer, hence 2; if we aren't, we @@ -1922,8 +1926,8 @@ public final class LatinIME extends InputMethodService implements KeyboardAction mConnection.getNthPreviousWord(mCurrentSettings.mWordSeparators, mWordComposer.isComposingWord() ? 2 : 1); final SuggestedWords suggestedWords = mSuggest.getSuggestedWords(mWordComposer, - prevWord, mKeyboardSwitcher.getKeyboard().getProximityInfo(), - mCurrentSettings.mCorrectionEnabled, sessionId); + prevWord, keyboard.getProximityInfo(), mCurrentSettings.mCorrectionEnabled, + sessionId); return maybeRetrieveOlderSuggestions(typedWord, suggestedWords); } |