flowpowered / react

Real-time physics library for Java, based on the ReactPhysics3D (https://code.google.com/p/reactphysics3d/) library by Daniel Chappuis (http://www.danielchappuis.ch/).
https://flow.github.io/react
MIT License
31 stars 7 forks source link

Fix IllegalArgumentException caused by null arrays #6

Closed kitskub closed 10 years ago

kitskub commented 10 years ago

When a DynamicsWorld is started and updated with no bodies in it, mConstrainedLinearVelocities in DynamicsWorld (among others) is null. This causes ContactSolver to throw an IllegalArgumentException.

To fix this, all null arrays are instead initialized as an empty array.

The test has also been updated. It fails prior to this change.

DDoS commented 10 years ago

Awesome