Merge "Fix an NPE"
commit
a40aba0022
|
@ -1875,15 +1875,17 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
|
|||
return;
|
||||
}
|
||||
|
||||
if (null != mSuggest && null != mUserUnigramDictionary) {
|
||||
final boolean selectedATypedWordAndItsInUserUnigramDic =
|
||||
!selectedANotTypedWord && mUserUnigramDictionary.isValidWord(suggestion);
|
||||
final boolean isValidWord = AutoCorrection.isValidWord(
|
||||
mSuggest.getUnigramDictionaries(), suggestion, true);
|
||||
final boolean needsToAddToUserUnigramDictionary = selectedATypedWordAndItsInUserUnigramDic
|
||||
|| !isValidWord;
|
||||
final boolean needsToAddToUserUnigramDictionary =
|
||||
selectedATypedWordAndItsInUserUnigramDic || !isValidWord;
|
||||
if (needsToAddToUserUnigramDictionary) {
|
||||
mUserUnigramDictionary.addWord(suggestion.toString(), frequencyDelta);
|
||||
}
|
||||
}
|
||||
|
||||
if (mUserBigramDictionary != null) {
|
||||
// We don't want to register as bigrams words separated by a separator.
|
||||
|
|
Loading…
Reference in New Issue