From 167ae1965e3e89102345f32b03a9d0f87d0b548f Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 17 Nov 2013 12:39:40 +1300 Subject: Fix H02 frame decoder --- src/org/traccar/protocol/H02FrameDecoder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/org') 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("*")) { -- cgit v1.2.3