diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/protocol/Gt06ProtocolDecoder.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java index 18524fcfa..6dc382a04 100644 --- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java @@ -214,9 +214,10 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { int commandLength = buf.readUnsignedByte(); - buf.readUnsignedByte(); // server flag (reserved) - - position.set("command", buf.readBytes(commandLength - 1).toString(StandardCharsets.US_ASCII)); + if (commandLength > 0) { + buf.readUnsignedByte(); // server flag (reserved) + position.set("command", buf.readBytes(commandLength - 1).toString(StandardCharsets.US_ASCII)); + } buf.readUnsignedShort(); // language |