MovingBlocks / box2d-editor

Automatically exported from code.google.com/p/box2d-editor - migrated here to maybe maintain together with Destination Sol. Original website:
https://code.google.com/archive/p/box2d-editor/
Apache License 2.0
84 stars 21 forks source link

NPE in RigidBodiesScreen.clearWorld() immediately upon startup #36

Closed smr99 closed 7 years ago

smr99 commented 7 years ago

The trace is:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at com.badlogic.gdx.physics.box2d.World.getBodies(World.java:910)
    at aurelienribon.bodyeditor.canvas.rigidbodies.RigidBodiesScreen.clearWorld(RigidBodiesScreen.java:578)
    at aurelienribon.bodyeditor.canvas.rigidbodies.RigidBodiesScreen.resetWorld(RigidBodiesScreen.java:678)
    at aurelienribon.bodyeditor.canvas.rigidbodies.RigidBodiesScreen.access$900(RigidBodiesScreen.java:59)
    at aurelienribon.bodyeditor.canvas.rigidbodies.RigidBodiesScreen$6.propertyChanged(RigidBodiesScreen.java:204)
    at aurelienribon.utils.notifications.ChangeableObject.firePropertyChanged(ChangeableObject.java:24)
    at aurelienribon.bodyeditor.RigidBodiesManager.select(RigidBodiesManager.java:37)
    at aurelienribon.bodyeditor.ui.MainWindow$3.windowOpened(MainWindow.java:67)

The failing line (in World.getBodies()) is: bodies.clear(); which is natural because you've passed in a null pointer.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

vampcat commented 7 years ago

@smr99 Similar to the other issue, can you create a pull request for this too?

Cervator commented 7 years ago

Yep, we wants it! :D

I just merged an outstanding older PR that helps but doesn't quite fix the loader (whatever it is ... secondary executable project). Hopefully that doesn't break too much stuff but I hear @vampcat might be wanting to help fix all the things anyway!

Cervator commented 7 years ago

We stole it shamelessly! Now merged. Thanks @smr99 :-)