NPE in PhysicsPicker


I’ve encountered a NPE within the PhysicsPicker whilst dragging a non physics object.

One of my game objects (a non-physics node) is dragged using the following code

The NPE occurs when I click and drag the non-physics object as above. The mouse is clicked near a Sphere and a Line node.

INFO: Moving targetPoint from com.jme.math.Vector3f [X=72.0991, Y=214.10696, Z=188.66808] to com.jme.math.Vector3f [X=72.0991, Y=214.10696, Z=188.66808]
   at com.jmex.physics.util.PhysicsPicker$PickAction.performAction(
   at com.jme.input.ActionTrigger.performAction(
   at com.jme.input.InputHandler.processTriggers(
   at com.jme.input.InputHandler.update(
   at com.jme.input.InputHandler.updateAttachedHandlers(
   at com.jme.input.InputHandler.update(
   at org.chrismills.stuntrobot.GameWorldState.stateUpdate(
   at org.chrismills.stuntrobot.StuntGame.update(
   at org.chrismills.stuntrobot.StuntGame.main(
11/11/2006 10:08:32 org.chrismills.stuntrobot.StuntGame cleanup

The NPE occurs at the following line

                   if ( data.getTargetTris().size() > 0 ) {

within the PhysicsPicker (latest CVS version). By stepping through the code, getTargetTris() returns null for one of the pickdata objects.

Does this issue just require a null check within PhysicsPicker

                   if (data.getTargetTris() &&  data.getTargetTris().size() > 0 ) {

or am I doing something wrong?

Ok, I've isolated the problem to a custom object I've subclassed from a com.jme.scene.Line node.

By not setting the modelBounds, I've removed it from the PickResults and removed my current NPE problem.

However I'm sure someone else will encounter this issue in the future. Given that lines can have a thickness, they should be able to have a bounding box, and not subsequently crash the PhysicsPicker.

sure that != null check is fine with me - checked in

Wonderful! thanks.