mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-06-17 11:59:34 +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)
|
||||
if (INVALID_CURSOR_POSITION != 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.
|
||||
// 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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue