Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextArea StringIndexOutOfBoundsException thrown after clicking text #3961

Closed
kotcrab opened this issue Mar 24, 2016 · 1 comment
Closed

TextArea StringIndexOutOfBoundsException thrown after clicking text #3961

kotcrab opened this issue Mar 24, 2016 · 1 comment

Comments

@kotcrab
Copy link
Contributor

kotcrab commented Mar 24, 2016

Issue details

There is some issue in TextArea that causes StringIndexOutOfBoundsException to be thrown. See reproduction steps.

Reproduction steps/code

  1. Run standard libgdx's TextAreaTest
  2. Move cursor to the very end of the text and start clicking repeatedly after last letter
  3. After few clicks crash will occur, reproducible every time. From what I tested this doesn't happen in TextField.

GIF

Version of LibGDX and/or relevant dependencies

Latest source

Stacktrace

Exception in thread "LWJGL Application" java.lang.StringIndexOutOfBoundsException: String index out of range: 7
    at java.lang.String.charAt(String.java:646)
    at com.badlogic.gdx.scenes.scene2d.ui.TextField.wordUnderCursor(TextField.java:166)
    at com.badlogic.gdx.scenes.scene2d.ui.TextField.wordUnderCursor(TextField.java:175)
    at com.badlogic.gdx.scenes.scene2d.ui.TextField$TextFieldClickListener.clicked(TextField.java:769)
    at com.badlogic.gdx.scenes.scene2d.utils.ClickListener.touchUp(ClickListener.java:89)
    at com.badlogic.gdx.scenes.scene2d.ui.TextField$TextFieldClickListener.touchUp(TextField.java:795)
    at com.badlogic.gdx.scenes.scene2d.InputListener.handle(InputListener.java:58)
    at com.badlogic.gdx.scenes.scene2d.Stage.touchUp(Stage.java:353)
    at com.badlogic.gdx.backends.lwjgl.LwjglInput.processEvents(LwjglInput.java:332)
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:215)
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:124)

Please select the affected platforms

  • Windows LWJGL2/LWJGL3

Others untested.

@xoppa
Copy link
Member

xoppa commented Mar 24, 2016

Duplicate of #3887

@xoppa xoppa closed this as completed Mar 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants