NASAWorldWind / WorldWindJava

The NASA WorldWind Java SDK (WWJ) is for building cross-platform 3D geospatial desktop applications in Java.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Read VPF header generate Exception

GogoTrash opened this issue · comments

When I try to read a VPF header with an empty narrative table name, it generates a StringIndexOutOfBoundsException in the VPFTableReader because it's empty at the line 200 (in the readHeader(ByteBuffer) method):

...
// Read the narrative table name.
s = VPFUtils.readDelimitedText(buffer, ';'); // <= Return an empty String
if (s != null && s.charAt(0) != '-') //<= And here s.charAt(0) return a StringIndexOutOfBoundsException
      header.narrativeTableName = s.trim();
...

I think if we add a condition if !s.isEmpty() it could resolve the problem.
Thanks