From 60e9026a968fb639a617670d8b03e052381d5c55 Mon Sep 17 00:00:00 2001 From: Matjaž Črnko Date: Sun, 1 Oct 2023 00:12:02 +0200 Subject: Ruptela: Fix a bug with extended records spanning multiple messages --- src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main/java/org') 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); + } } } -- cgit v1.2.3