aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/H02FrameDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2013-11-17 12:39:40 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2013-11-17 12:39:40 +1300
commit167ae1965e3e89102345f32b03a9d0f87d0b548f (patch)
tree069794780f84afe4559fb35141949cabda731e17 /src/org/traccar/protocol/H02FrameDecoder.java
parentb7429d1e8110f8a5baf58edad652ad50c4c9d38e (diff)
downloadtrackermap-server-167ae1965e3e89102345f32b03a9d0f87d0b548f.tar.gz
trackermap-server-167ae1965e3e89102345f32b03a9d0f87d0b548f.tar.bz2
trackermap-server-167ae1965e3e89102345f32b03a9d0f87d0b548f.zip
Fix H02 frame decoder
Diffstat (limited to 'src/org/traccar/protocol/H02FrameDecoder.java')
-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("*")) {