mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
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
@ -1872,14 +1872,16 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
|
||||
return;
|
||||
}
|
||||
|
||||
final boolean selectedATypedWordAndItsInUserUnigramDic =
|
||||
!selectedANotTypedWord && mUserUnigramDictionary.isValidWord(suggestion);
|
||||
final boolean isValidWord = AutoCorrection.isValidWord(
|
||||
mSuggest.getUnigramDictionaries(), suggestion, true);
|
||||
final boolean needsToAddToUserUnigramDictionary = selectedATypedWordAndItsInUserUnigramDic
|
||||
|| !isValidWord;
|
||||
if (needsToAddToUserUnigramDictionary) {
|
||||
mUserUnigramDictionary.addWord(suggestion.toString(), frequencyDelta);
|
||||
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;
|
||||
if (needsToAddToUserUnigramDictionary) {
|
||||
mUserUnigramDictionary.addWord(suggestion.toString(), frequencyDelta);
|
||||
}
|
||||
}
|
||||
|
||||
if (mUserBigramDictionary != null) {
|
||||
|
Loading…
Reference in New Issue
Block a user