Skip to content

Read VPF header generate Exception #263

Description

@GogoTrash

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions