Skip to content

Commit

Permalink
✔NPE when invoking getReadTally() on InputStream while writing.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjritola committed Apr 17, 2024
1 parent 3084b35 commit 1a0418f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/java/org/jtrfp/jfdt/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Objects;
import java.util.Stack;


Expand Down Expand Up @@ -799,8 +800,7 @@ public PROPERTY_CLASS get(ThirdPartyParseable bean)
Class<?> indexingClass=null;
try{indexingClass=Parser.this.getPropertyReturnType(bean, propertyName);}
catch(NoSuchMethodException e){
final long readTally = is.getReadTally();
throw new RuntimeException("Occurred at byte "+readTally+" (0x"+Long.toHexString(readTally).toUpperCase()+")",e);}
throw new RuntimeException(e);}
if(List.class.isAssignableFrom(indexingClass))
{@SuppressWarnings("unchecked")
List<PROPERTY_CLASS> list = (List<PROPERTY_CLASS>)Parser.this.get(bean, propertyName,indexingClass);
Expand Down Expand Up @@ -1258,8 +1258,7 @@ public void write(EndianAwareDataOutputStream os,
Class<?> indexingClass=null;
try{indexingClass=Parser.this.getPropertyReturnType(bean, arrayOrListPropertyName);}
catch(NoSuchMethodException e){
final long readTally = is.getReadTally();
throw new RuntimeException("Occurred at byte "+readTally+" (0x"+Long.toHexString(readTally).toUpperCase()+")",e);
throw new RuntimeException(e);
}

if(List.class.isAssignableFrom(indexingClass))
Expand Down

0 comments on commit 1a0418f

Please sign in to comment.