1
0
Fork 0

fixed a rare NullPointerException when changing the text case right when the suggestion list becomes empty

This commit is contained in:
sspanak 2025-06-10 13:34:26 +03:00 committed by Dimo Karaivanov
parent 78b78923cf
commit a5a34693fc

View file

@ -218,8 +218,8 @@ abstract public class CommandHandler extends TextEditingHandler {
}
// if there are no suggestions or they are special chars, we don't need to adjust their text case
final String before = suggestionOps.getCurrent();
boolean beforeStartsWithLetter = !before.isEmpty() && Character.isAlphabetic(before.charAt(0));
final String before = suggestionOps.isEmpty() || mInputMode.getSequence().isEmpty() ? "" : suggestionOps.getCurrent();
final boolean beforeStartsWithLetter = !before.isEmpty() && Character.isAlphabetic(before.charAt(0));
if (!beforeStartsWithLetter) {
settings.saveTextCase(mInputMode.getTextCase());
return true;