From ff6a7b59b84dbb648f35e08f013f8852060e321d Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 31 Dec 2018 10:10:08 -0800 Subject: Handle Queclink GTSTC messages (fix #4173) --- src/org/traccar/protocol/Gl200TextProtocolDecoder.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/org/traccar/protocol') diff --git a/src/org/traccar/protocol/Gl200TextProtocolDecoder.java b/src/org/traccar/protocol/Gl200TextProtocolDecoder.java index 97cc8f987..31ff4a670 100644 --- a/src/org/traccar/protocol/Gl200TextProtocolDecoder.java +++ b/src/org/traccar/protocol/Gl200TextProtocolDecoder.java @@ -1079,9 +1079,11 @@ public class Gl200TextProtocolDecoder extends BaseProtocolDecoder { return null; } - int hdop = parser.nextInt(); - position.setValid(hdop > 0); - position.set(Position.KEY_HDOP, hdop); + if (parser.hasNext()) { + int hdop = parser.nextInt(); + position.setValid(hdop > 0); + position.set(Position.KEY_HDOP, hdop); + } position.setSpeed(UnitsConverter.knotsFromKph(parser.nextDouble(0))); position.setCourse(parser.nextDouble(0)); -- cgit v1.2.3