NASAWorldWind / WorldWindJava

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

DTED read NPE with null AVList argument #92

Open zglueck opened 7 years ago

zglueck commented 7 years ago

From: https://forum.worldwindcentral.com/forum/world-wind-java-forums/development-help/156783-bug-npe-in-dted-java

To reproduce this, simply launch gov.nasa.worldwindx.examples.SurfaceImag eViewer and try to add a DTED file. Here is the exception:

Exception in thread "Thread-23" java.lang.NullPointerException
at gov.nasa.worldwind.formats.dted.DTED.rea dUHL(DTED.java:322)
at gov.nasa.worldwind.formats.dted.DTED.rea d(DTED.java:123)
at gov.nasa.worldwind.data.DTEDRasterReader .doRead(DTEDRasterReader.java:95)
at gov.nasa.worldwind.data.AbstractDataRast erReader.read(AbstractDataRasterReader.j ava:117)
at gov.nasa.worldwind.terrain.LocalElevatio nModel.addElevations(LocalElevationModel .java:339)
at gov.nasa.worldwind.terrain.LocalElevatio nModel.addElevations(LocalElevationModel .java:293)
at gov.nasa.worldwindx.examples.SurfaceImag eViewer$AppFrame$1$1.run(SurfaceImageVie wer.java:90)
at java.lang.Thread.run(Thread.java:745)

A new AVList argument was added to gov.nasa.worldwind.formats.dted.DTED.rea d() This gets called by gov.nasa.worldwind.data.DTEDRasterReader .doRead(), which has always accepted an AVList argument, but now it passes it to the read() method. The problem happens in the line in bold. We still send a null value for the AVList argument, but this null eventually gets operated on, leading to the NPE.

dksteele commented 7 years ago

Has there been any progress towards getting a fix for this into the code?

zglueck commented 7 years ago

@dksteele sorry, no, not yet. The forum post linked above contained a work around.