aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/Gt06ProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol/Gt06ProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/Gt06ProtocolDecoder.java7
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