Skip to content

Commit

Permalink
Avoid photo null pointer exception
Browse files Browse the repository at this point in the history
  • Loading branch information
tananaev committed Jan 3, 2018
1 parent ee2fbc5 commit 01eae91
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/org/traccar/protocol/MeitrackProtocolDecoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,10 @@ protected Object decode(

switch (type) {
case "D00":
if (photo == null) {
return null;
}

index = buf.indexOf(index + 1 + type.length() + 1, buf.writerIndex(), (byte) ',') + 1;
int endIndex = buf.indexOf(index, buf.writerIndex(), (byte) ',');
int total = Integer.parseInt(buf.toString(index, endIndex - index, StandardCharsets.US_ASCII));
Expand Down

0 comments on commit 01eae91

Please sign in to comment.