aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-02-15 11:11:01 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2020-02-15 11:11:01 -0800
commit8bf4c171e1771eb89506a87ba8435776ee61286e (patch)
tree330e58559ea6048ba5510cc3bf82a4424a88ad02 /src/main/java/org/traccar
parentc860f15e6a541c72d901d928941912edb943883e (diff)
downloadtrackermap-server-8bf4c171e1771eb89506a87ba8435776ee61286e.tar.gz
trackermap-server-8bf4c171e1771eb89506a87ba8435776ee61286e.tar.bz2
trackermap-server-8bf4c171e1771eb89506a87ba8435776ee61286e.zip
Fix ADC decoding
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r--src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java b/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java
index 7e520ab3a..978d768be 100644
--- a/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java
@@ -397,7 +397,7 @@ public class SuntechProtocolDecoder extends BaseProtocolDecoder {
if (isIncludeAdc(deviceSession.getDeviceId())) {
for (int i = 1; i <= 3; i++) {
- if (!values[index++].isEmpty()) {
+ if (index < values.length && !values[index++].isEmpty()) {
position.set(Position.PREFIX_ADC + i, Double.parseDouble(values[index - 1]));
}
}