aboutsummaryrefslogtreecommitdiff
path: root/src
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
parentee2fbc5cb8bb5dc017eed3db3785fb8c2166df67 (diff)
downloadtraccar-server-01eae916a1b2f39664dbeea2fcf7fb45158f8212.tar.gz
traccar-server-01eae916a1b2f39664dbeea2fcf7fb45158f8212.tar.bz2
traccar-server-01eae916a1b2f39664dbeea2fcf7fb45158f8212.zip
Avoid photo null pointer exception
Diffstat (limited to 'src')
-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));