aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/MeitrackProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-01-04 01:16:04 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2018-01-04 01:16:04 +1300
commit01eae916a1b2f39664dbeea2fcf7fb45158f8212 (patch)
tree64dd7d3289b25e517042717c311d3db9374b6410 /src/org/traccar/protocol/MeitrackProtocolDecoder.java
parentee2fbc5cb8bb5dc017eed3db3785fb8c2166df67 (diff)
downloadtrackermap-server-01eae916a1b2f39664dbeea2fcf7fb45158f8212.tar.gz
trackermap-server-01eae916a1b2f39664dbeea2fcf7fb45158f8212.tar.bz2
trackermap-server-01eae916a1b2f39664dbeea2fcf7fb45158f8212.zip
Avoid photo null pointer exception
Diffstat (limited to 'src/org/traccar/protocol/MeitrackProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/MeitrackProtocolDecoder.java4
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));