From 86c0a49ceb012c36fe0bc30be63e27e7608d0f63 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 19 Mar 2016 10:50:29 +1300 Subject: Properly handle empty messages --- src/org/traccar/protocol/T55ProtocolDecoder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/org/traccar') diff --git a/src/org/traccar/protocol/T55ProtocolDecoder.java b/src/org/traccar/protocol/T55ProtocolDecoder.java index 71f493318..813d58ba8 100644 --- a/src/org/traccar/protocol/T55ProtocolDecoder.java +++ b/src/org/traccar/protocol/T55ProtocolDecoder.java @@ -237,7 +237,7 @@ public class T55ProtocolDecoder extends BaseProtocolDecoder { this.position = null; return position; } - } else if (Character.isDigit(sentence.charAt(0)) && sentence.length() == 15) { + } else if (sentence.length() == 15 && Character.isDigit(sentence.charAt(0))) { identify(sentence, channel, remoteAddress); } else if (sentence.startsWith("$GPRMC")) { return decodeGprmc(sentence, remoteAddress, channel); -- cgit v1.2.3