diff options
author | 2012-10-02 22:44:57 -0700 | |
---|---|---|
committer | 2012-10-02 22:44:57 -0700 | |
commit | 5f5f7825e741b3a599490592b3955f95d2a9225f (patch) | |
tree | 55db5960a41c5d8dab2de26ac575029c280005a5 /java/src/com/android/inputmethod/latin/LatinIME.java | |
parent | 4ad4ff618f5102148d73e3c04d809942bcf16f86 (diff) | |
parent | 4d009dbc514cd77eb22e4162e4ae7ea852e1b77e (diff) | |
download | latinime-5f5f7825e741b3a599490592b3955f95d2a9225f.tar.gz latinime-5f5f7825e741b3a599490592b3955f95d2a9225f.tar.xz latinime-5f5f7825e741b3a599490592b3955f95d2a9225f.zip |
am 4d009dbc: am ace7d128: am d445b56c: Fix possible NPE caused while monkey test
* commit '4d009dbc514cd77eb22e4162e4ae7ea852e1b77e':
Fix possible NPE caused while monkey test
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); } |