Merge "Fix an NPE"
This commit is contained in:
commit
a40aba0022
1 changed files with 10 additions and 8 deletions
|
@ -1875,14 +1875,16 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final boolean selectedATypedWordAndItsInUserUnigramDic =
|
if (null != mSuggest && null != mUserUnigramDictionary) {
|
||||||
!selectedANotTypedWord && mUserUnigramDictionary.isValidWord(suggestion);
|
final boolean selectedATypedWordAndItsInUserUnigramDic =
|
||||||
final boolean isValidWord = AutoCorrection.isValidWord(
|
!selectedANotTypedWord && mUserUnigramDictionary.isValidWord(suggestion);
|
||||||
mSuggest.getUnigramDictionaries(), suggestion, true);
|
final boolean isValidWord = AutoCorrection.isValidWord(
|
||||||
final boolean needsToAddToUserUnigramDictionary = selectedATypedWordAndItsInUserUnigramDic
|
mSuggest.getUnigramDictionaries(), suggestion, true);
|
||||||
|| !isValidWord;
|
final boolean needsToAddToUserUnigramDictionary =
|
||||||
if (needsToAddToUserUnigramDictionary) {
|
selectedATypedWordAndItsInUserUnigramDic || !isValidWord;
|
||||||
mUserUnigramDictionary.addWord(suggestion.toString(), frequencyDelta);
|
if (needsToAddToUserUnigramDictionary) {
|
||||||
|
mUserUnigramDictionary.addWord(suggestion.toString(), frequencyDelta);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mUserBigramDictionary != null) {
|
if (mUserBigramDictionary != null) {
|
||||||
|
|
Loading…
Reference in a new issue