Attempt to fix crash in processUpdateSuggestionStrip

This commit is contained in:
Aleksandras Kostarevas 2024-07-24 23:59:34 +03:00
parent bdfa736e1f
commit e0bd7b2c63

View File

@ -237,19 +237,21 @@ public class LanguageModelFacilitator(
computationSemaphore.acquire()
inputLogic.mWordComposer.setAutoCorrection(null)
if(values.composedData.mTypedWord.length > BinaryDictionary.DICTIONARY_MAX_WORD_LENGTH) {
inputLogic.mSuggestionStripViewAccessor.setNeutralSuggestionStrip()
}
try {
inputLogic.mWordComposer.setAutoCorrection(null)
if(values.composedData.mTypedWord.length > BinaryDictionary.DICTIONARY_MAX_WORD_LENGTH) {
inputLogic.mSuggestionStripViewAccessor.setNeutralSuggestionStrip()
return
}
var transformerWeight = context.getSetting(BinaryDictTransformerWeightSetting)
val holder = AsyncResultHolder<SuggestedWords?>("Suggest")
inputLogic.getSuggestedWords(
settings.current,
keyboardSwitcher.keyboard,
keyboardSwitcher.keyboard ?: return,
keyboardSwitcher.keyboardShiftMode,
values.inputStyle,
SuggestedWords.NOT_A_SEQUENCE_NUMBER