mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-05-04 05:34:47 +00:00
fix crash
This commit is contained in:
parent
dd16ac2135
commit
3147d22a18
1 changed files with 2 additions and 2 deletions
|
@ -1534,9 +1534,9 @@ public final class InputLogic {
|
||||||
final String result;
|
final String result;
|
||||||
if (settingsValues.mSpacingAndPunctuations.isWordSeparator(word.codePointBefore(word.length()))) {
|
if (settingsValues.mSpacingAndPunctuations.isWordSeparator(word.codePointBefore(word.length()))) {
|
||||||
int endIndex = word.length() - 1;
|
int endIndex = word.length() - 1;
|
||||||
while (settingsValues.mSpacingAndPunctuations.isWordSeparator(word.codePointBefore(endIndex)))
|
while (endIndex != 0 && settingsValues.mSpacingAndPunctuations.isWordSeparator(word.codePointBefore(endIndex)))
|
||||||
--endIndex;
|
--endIndex;
|
||||||
result = word.substring(0, endIndex);
|
result = (endIndex > 0) ? word.substring(0, endIndex) : word;
|
||||||
} else
|
} else
|
||||||
result = word;
|
result = word;
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Add table
Reference in a new issue