diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2013-11-17 12:39:40 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2013-11-17 12:39:40 +1300 |
commit | 167ae1965e3e89102345f32b03a9d0f87d0b548f (patch) | |
tree | 069794780f84afe4559fb35141949cabda731e17 /src/org | |
parent | b7429d1e8110f8a5baf58edad652ad50c4c9d38e (diff) | |
download | traccar-server-167ae1965e3e89102345f32b03a9d0f87d0b548f.tar.gz traccar-server-167ae1965e3e89102345f32b03a9d0f87d0b548f.tar.bz2 traccar-server-167ae1965e3e89102345f32b03a9d0f87d0b548f.zip |
Fix H02 frame decoder
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/traccar/protocol/H02FrameDecoder.java | 4 |
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("*")) { |