mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-06-18 15:15:21 +00:00
avoid StringIndexOutOfBoundsException when initializing stringbuilder from other stringbuilder
This commit is contained in:
parent
ef3191a2eb
commit
24a2eddc1f
1 changed files with 1 additions and 1 deletions
|
@ -439,7 +439,7 @@ public final class RichInputConnection implements PrivateCommandPerformer {
|
||||||
// test for this explicitly)
|
// test for this explicitly)
|
||||||
if (INVALID_CURSOR_POSITION != mExpectedSelStart
|
if (INVALID_CURSOR_POSITION != mExpectedSelStart
|
||||||
&& (cachedLength >= n || cachedLength >= mExpectedSelStart)) {
|
&& (cachedLength >= n || cachedLength >= mExpectedSelStart)) {
|
||||||
final StringBuilder s = new StringBuilder(mCommittedTextBeforeComposingText);
|
final StringBuilder s = new StringBuilder(mCommittedTextBeforeComposingText.toString());
|
||||||
// We call #toString() here to create a temporary object.
|
// We call #toString() here to create a temporary object.
|
||||||
// In some situations, this method is called on a worker thread, and it's possible
|
// In some situations, this method is called on a worker thread, and it's possible
|
||||||
// the main thread touches the contents of mComposingText while this worker thread
|
// the main thread touches the contents of mComposingText while this worker thread
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue