aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/org/traccar/protocol/H02FrameDecoder.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/H02FrameDecoder.java b/src/org/traccar/protocol/H02FrameDecoder.java
index b1793825e..1c9e9e6c1 100644
--- a/src/org/traccar/protocol/H02FrameDecoder.java
+++ b/src/org/traccar/protocol/H02FrameDecoder.java
@@ -36,7 +36,9 @@ public class H02FrameDecoder extends FrameDecoder {
while (!marker.equals("*") && !marker.equals("$") && buf.readableBytes() > 0) {
buf.skipBytes(1);
- marker = buf.toString(buf.readerIndex(), 1, Charset.defaultCharset());
+ if (buf.readableBytes() > 0) {
+ marker = buf.toString(buf.readerIndex(), 1, Charset.defaultCharset());
+ }
}
if (marker.equals("*")) {