Fix an NPE
I think only the monkey can realistically stumble on this one, but still. Bug: 5276917 Change-Id: I0d9f76e4786973d3695fcd46127f0bed46621c33
This commit is contained in:
parent
a08a7e99b4
commit
5955cfdaea
1 changed files with 10 additions and 8 deletions
|
@ -1872,15 +1872,17 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (null != mSuggest && null != mUserUnigramDictionary) {
|
||||||
final boolean selectedATypedWordAndItsInUserUnigramDic =
|
final boolean selectedATypedWordAndItsInUserUnigramDic =
|
||||||
!selectedANotTypedWord && mUserUnigramDictionary.isValidWord(suggestion);
|
!selectedANotTypedWord && mUserUnigramDictionary.isValidWord(suggestion);
|
||||||
final boolean isValidWord = AutoCorrection.isValidWord(
|
final boolean isValidWord = AutoCorrection.isValidWord(
|
||||||
mSuggest.getUnigramDictionaries(), suggestion, true);
|
mSuggest.getUnigramDictionaries(), suggestion, true);
|
||||||
final boolean needsToAddToUserUnigramDictionary = selectedATypedWordAndItsInUserUnigramDic
|
final boolean needsToAddToUserUnigramDictionary =
|
||||||
|| !isValidWord;
|
selectedATypedWordAndItsInUserUnigramDic || !isValidWord;
|
||||||
if (needsToAddToUserUnigramDictionary) {
|
if (needsToAddToUserUnigramDictionary) {
|
||||||
mUserUnigramDictionary.addWord(suggestion.toString(), frequencyDelta);
|
mUserUnigramDictionary.addWord(suggestion.toString(), frequencyDelta);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (mUserBigramDictionary != null) {
|
if (mUserBigramDictionary != null) {
|
||||||
// We don't want to register as bigrams words separated by a separator.
|
// We don't want to register as bigrams words separated by a separator.
|
||||||
|
|
Loading…
Reference in a new issue