NASAWorldWind / WorldWindJava

The NASA WorldWind Java SDK (WWJ) is for building cross-platform 3D geospatial desktop applications in Java.
719 stars 327 forks source link

NPE from MeasureToolController when trying to drag shape. #33

Closed dr3amr2 closed 7 years ago

dr3amr2 commented 7 years ago

I'm testing out the MeasureToolController by running MeasureToolUsage.main(). I drew a Square shape on the globe and tried to drag it, but immediately got the following errors.

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at gov.nasa.worldwind.render.GlobeAnnotation.drag(GlobeAnnotation.java:248) at gov.nasa.worldwind.util.BasicDragger.fireDrag(BasicDragger.java:172) at gov.nasa.worldwind.util.BasicDragger.selected(BasicDragger.java:117) at gov.nasa.worldwind.util.measure.MeasureToolController.dragSelected(MeasureToolController.java:451) at gov.nasa.worldwind.util.measure.MeasureToolController.doSelected(MeasureToolController.java:439) at gov.nasa.worldwind.util.measure.MeasureToolController.selected(MeasureToolController.java:334) at gov.nasa.worldwind.awt.AWTInputHandler.callSelectListeners(AWTInputHandler.java:721) at gov.nasa.worldwind.awt.AWTInputHandler.cancelDrag(AWTInputHandler.java:700)

This issue is reproducible 100% of the time. That's all the info I have regarding this issue for now, I'm more than happy to help if you need any additional information from me.

zglueck commented 7 years ago

@dr3amr2 thanks for spotting this. I believe this is due to the GlobeAnnotation using an Integer object which isn't initialized instead of a primitive. We're running down some other issues right now but I'll put this on the TODO.

dr3amr2 commented 7 years ago

@zglueck Awesome, thanks for looking into this.