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

Crash when overlapping polygon #91

Open
myyk opened this issue Nov 20, 2023 · 2 comments
Open

Crash when overlapping polygon #91

myyk opened this issue Nov 20, 2023 · 2 comments

Comments

@myyk
Copy link

myyk commented Nov 20, 2023

Describe the bug
I was drawing a polygon that wrapped around itself and caused the app to crash.

To Reproduce
I couldn't repro the bug.

Steps to reproduce the behavior:

  1. 'Create Primitive'
  2. Use 'Polygon Tool'
  3. Draw a doughnut like shape with around 20 vertices.
  4. Maybe it was random that it crashed when I had made the vertices overlap.
  5. Crash

Expected behavior
No crash.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Ubuntu
  • HyperLap2D Version: 0.1.4-snapshot 5db7ae2

Additional context
Polygon looked something like this before it crashed, with the "8"-vertex being moved over the point to the left of it:
Screenshot from 2023-11-20 15-30-30

Stacktrace from crash

java.lang.NullPointerException: Cannot read the array length because "data" is null
        at games.rednblack.editor.controller.commands.component.UpdatePolygonVerticesCommand.cloneData(UpdatePolygonVerticesCommand.java:95)
        at games.rednblack.editor.controller.commands.component.UpdatePolygonVerticesCommand.payload(UpdatePolygonVerticesCommand.java:86)
        at games.rednblack.editor.view.stage.tools.PolygonTool.vertexUp(PolygonTool.java:149)
        at games.rednblack.editor.view.ui.followers.PolygonFollower$LineClickListener.touchUp(PolygonFollower.java:287)
        at com.badlogic.gdx.scenes.scene2d.InputListener.handle(InputListener.java:71)
        at com.badlogic.gdx.scenes.scene2d.Stage.touchUp(Stage.java:354)
        at com.badlogic.gdx.InputMultiplexer.touchUp(InputMultiplexer.java:124)
        at com.badlogic.gdx.InputEventQueue.drain(InputEventQueue.java:70)
        at com.badlogic.gdx.backends.lwjgl3.DefaultLwjgl3Input.update(DefaultLwjgl3Input.java:189)
        at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window.update(Lwjgl3Window.java:378)
        at com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationGLESFix.loop(Lwjgl3ApplicationGLESFix.java:192)
        at com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationGLESFix.<init>(Lwjgl3ApplicationGLESFix.java:166)
        at games.rednblack.editor.Main.main(Main.java:57)

@fgnm
Copy link
Member

fgnm commented Nov 20, 2023

Really thanks for all the detailed reports :) In the last commit I probably catch up the NPE but not sure, I'll let this open if you experience other crashes

@myyk
Copy link
Author

myyk commented Nov 20, 2023

No problem, I'm glad they're helpful. I felt bad creating them but then realized I would appreciate them created for my projects.

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