aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorMatjaž Črnko <m.crnko@txt.si>2023-10-01 00:12:02 +0200
committerMatjaž Črnko <m.crnko@txt.si>2023-10-01 00:12:02 +0200
commit60e9026a968fb639a617670d8b03e052381d5c55 (patch)
tree9d66ebf32655bec5c561d80f5ff1794fa73dd8ff /src/main
parent0ad9b4c84b5eb4b9b58f8ca45adff99526ae193e (diff)
downloadtrackermap-server-60e9026a968fb639a617670d8b03e052381d5c55.tar.gz
trackermap-server-60e9026a968fb639a617670d8b03e052381d5c55.tar.bz2
trackermap-server-60e9026a968fb639a617670d8b03e052381d5c55.zip
Ruptela: Fix a bug with extended records spanning multiple messages
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java b/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java
index b381b93f8..d4f9808ae 100644
--- a/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java
@@ -243,7 +243,11 @@ public class RuptelaProtocolDecoder extends BaseProtocolDecoder {
int currentRecord = BitUtil.to(recordExtension, 4);
if (currentRecord > 0 && currentRecord <= mergeRecordCount) {
- position = positions.remove(positions.size() - 1);
+ if (positions.size() == 0) {
+ getLastLocation(position, null);
+ } else {
+ position = positions.remove(positions.size() - 1);
+ }
}
}