From 612547f1b0cae5e0ba39359ed349799f2a87ca2f Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 13 Mar 2018 01:00:09 +1300 Subject: Handle missing temperature (fix #3806) --- src/org/traccar/protocol/Gl200TextProtocolDecoder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/org') 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); + } } } -- cgit v1.2.3