diff options
author | 2011-05-13 20:27:01 +0900 | |
---|---|---|
committer | 2011-05-13 20:34:53 +0900 | |
commit | fe1a6d961cf039357f061482461e4d2e951ad346 (patch) | |
tree | 1ab4330b43aea568547ff5d7455678722882b530 /java/src | |
parent | 950def1df3f272a8a9f2fad8b207ee4858883b20 (diff) | |
download | latinime-fe1a6d961cf039357f061482461e4d2e951ad346.tar.gz latinime-fe1a6d961cf039357f061482461e4d2e951ad346.tar.xz latinime-fe1a6d961cf039357f061482461e4d2e951ad346.zip |
Fix null pointer exception in LatinIME
Change-Id: Ic4d60fe651bdc83771137c0f61f07c3879a3f1a1
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 2d4d7b989..e1fa0abf6 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1465,14 +1465,17 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar // in most cases, suggestion count is 1 when typed word's length is 1, but we do always // need to clear the previous state when the user starts typing a word (i.e. typed word's // length == 1). - if (builder.size() > 1 || typedWord.length() == 1 || typedWordValid - || mCandidateView.isShowingAddToDictionaryHint()) { - builder.setTypedWordValid(typedWordValid).setHasMinimalSuggestion(correctionAvailable); - } else { - final SuggestedWords previousSuggestions = mCandidateView.getSuggestions(); - if (previousSuggestions == mSettingsValues.mSuggestPuncList) - return; - builder.addTypedWordAndPreviousSuggestions(typedWord, previousSuggestions); + if (typedWord != null) { + if (builder.size() > 1 || typedWord.length() == 1 || typedWordValid + || mCandidateView.isShowingAddToDictionaryHint()) { + builder.setTypedWordValid(typedWordValid).setHasMinimalSuggestion( + correctionAvailable); + } else { + final SuggestedWords previousSuggestions = mCandidateView.getSuggestions(); + if (previousSuggestions == mSettingsValues.mSuggestPuncList) + return; + builder.addTypedWordAndPreviousSuggestions(typedWord, previousSuggestions); + } } showSuggestions(builder.build(), typedWord); } |