diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-01-04 01:16:04 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-01-04 01:16:04 +1300 |
commit | 01eae916a1b2f39664dbeea2fcf7fb45158f8212 (patch) | |
tree | 64dd7d3289b25e517042717c311d3db9374b6410 /src | |
parent | ee2fbc5cb8bb5dc017eed3db3785fb8c2166df67 (diff) | |
download | trackermap-server-01eae916a1b2f39664dbeea2fcf7fb45158f8212.tar.gz trackermap-server-01eae916a1b2f39664dbeea2fcf7fb45158f8212.tar.bz2 trackermap-server-01eae916a1b2f39664dbeea2fcf7fb45158f8212.zip |
Avoid photo null pointer exception
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/protocol/MeitrackProtocolDecoder.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/MeitrackProtocolDecoder.java b/src/org/traccar/protocol/MeitrackProtocolDecoder.java index 259283c19..3de71fa14 100644 --- a/src/org/traccar/protocol/MeitrackProtocolDecoder.java +++ b/src/org/traccar/protocol/MeitrackProtocolDecoder.java @@ -459,6 +459,10 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder { 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)); |