diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-03-13 01:00:09 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-03-13 01:00:09 +1300 |
commit | 612547f1b0cae5e0ba39359ed349799f2a87ca2f (patch) | |
tree | 0714fcfa5b72a853ff994d348863a0f3c0e56e4c /src | |
parent | 708c38728c8c250ba7205cd7fd77182895d1ea07 (diff) | |
download | traccar-server-612547f1b0cae5e0ba39359ed349799f2a87ca2f.tar.gz traccar-server-612547f1b0cae5e0ba39359ed349799f2a87ca2f.tar.bz2 traccar-server-612547f1b0cae5e0ba39359ed349799f2a87ca2f.zip |
Handle missing temperature (fix #3806)
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/protocol/Gl200TextProtocolDecoder.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/Gl200TextProtocolDecoder.java b/src/org/traccar/protocol/Gl200TextProtocolDecoder.java index 362fc38c7..ff300d429 100644 --- a/src/org/traccar/protocol/Gl200TextProtocolDecoder.java +++ b/src/org/traccar/protocol/Gl200TextProtocolDecoder.java @@ -787,7 +787,9 @@ public class Gl200TextProtocolDecoder extends BaseProtocolDecoder { for (int i = 1; i <= deviceCount; i++) { index += 1; // id index += 1; // type - position.set(Position.PREFIX_TEMP + i, (short) Integer.parseInt(data[index++], 16) * 0.0625); + if (!data[index++].isEmpty()) { + position.set(Position.PREFIX_TEMP + i, (short) Integer.parseInt(data[index - 1], 16) * 0.0625); + } } } |