aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/helper/Parser.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-02-18 13:56:32 -0800
committerAnton Tananaev <anton@traccar.org>2023-02-18 13:56:32 -0800
commit8ae0436e5edb76243e59ee6e9b2c1a6132fd9464 (patch)
treeb85665e339876d3e8d5931be11188bffa7e0c7b3 /src/main/java/org/traccar/helper/Parser.java
parentec2b7b64a83aa1c3dcd0cd69c1ae7b2d0d8a7864 (diff)
downloadtrackermap-server-8ae0436e5edb76243e59ee6e9b2c1a6132fd9464.tar.gz
trackermap-server-8ae0436e5edb76243e59ee6e9b2c1a6132fd9464.tar.bz2
trackermap-server-8ae0436e5edb76243e59ee6e9b2c1a6132fd9464.zip
Fix Queclink GL53MG decoding
Diffstat (limited to 'src/main/java/org/traccar/helper/Parser.java')
-rw-r--r--src/main/java/org/traccar/helper/Parser.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/helper/Parser.java b/src/main/java/org/traccar/helper/Parser.java
index aa39e1ad7..c2aea28fa 100644
--- a/src/main/java/org/traccar/helper/Parser.java
+++ b/src/main/java/org/traccar/helper/Parser.java
@@ -50,6 +50,17 @@ public class Parser {
public boolean hasNext(int number) {
for (int i = position; i < position + number; i++) {
String value = matcher.group(i);
+ if (value == null || value.isEmpty()) {
+ position += number;
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public boolean hasNextAny(int number) {
+ for (int i = position; i < position + number; i++) {
+ String value = matcher.group(i);
if (value != null && !value.isEmpty()) {
return true;
}