This PR adds exception handling for an IndexOutOfBoundsException thrown from the SpannableStringBuilder when the requested character position >= length on rare occasions.
Test
I did not find a way to reproduce the issue. Thus I suggest a sanity check like the following:
Open the editor
Apply some style
Place the cursor inside the style span
Accept a keyboard suggestion
Verify that no crash occurs and that the style is applied after the text change
Fixes https://github.com/wordpress-mobile/WordPress-Android/issues/20481
Related PRs:
Description
This PR adds exception handling for an
IndexOutOfBoundsException
thrown from theSpannableStringBuilder
when the requested character position >= length on rare occasions.Test
I did not find a way to reproduce the issue. Thus I suggest a sanity check like the following:
https://github.com/wordpress-mobile/AztecEditor-Android/assets/304044/0a1b1b4d-1425-4d1e-89db-7e3c9847980b
Make sure strings will be translated:
strings.xml
as a part of the integration PR.