aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/protocol')
-rw-r--r--src/main/java/org/traccar/protocol/MegastekProtocolDecoder.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/MegastekProtocolDecoder.java b/src/main/java/org/traccar/protocol/MegastekProtocolDecoder.java
index 2ce5b9dae..e63dd3b32 100644
--- a/src/main/java/org/traccar/protocol/MegastekProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/MegastekProtocolDecoder.java
@@ -141,7 +141,7 @@ public class MegastekProtocolDecoder extends BaseProtocolDecoder {
beginIndex = endIndex + 2;
endIndex = sentence.indexOf('*', beginIndex) + 3;
- if (beginIndex > endIndex) {
+ if (endIndex < 0) {
return null;
}
location = sentence.substring(beginIndex, endIndex);