aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-06-05 19:51:41 -0700
committerAnton Tananaev <anton@traccar.org>2023-06-05 19:51:41 -0700
commit1df3562c439ac8d23c1f03e60acba39468de138c (patch)
tree36e2c5903ccb0db7d73f24e9529828ab8a5f3bc0 /src/main
parentfdbd269b9b99de074e2fd9d99d1702620102801b (diff)
downloadtrackermap-server-1df3562c439ac8d23c1f03e60acba39468de138c.tar.gz
trackermap-server-1df3562c439ac8d23c1f03e60acba39468de138c.tar.bz2
trackermap-server-1df3562c439ac8d23c1f03e60acba39468de138c.zip
Handle missing positions (fix #5104)
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/reports/common/ReportUtils.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/reports/common/ReportUtils.java b/src/main/java/org/traccar/reports/common/ReportUtils.java
index 28e3d2ae5..995e92676 100644
--- a/src/main/java/org/traccar/reports/common/ReportUtils.java
+++ b/src/main/java/org/traccar/reports/common/ReportUtils.java
@@ -392,7 +392,10 @@ public class ReportUtils {
new Columns.All(), new Condition.Equals("id", startEvent.getPositionId())));
Position endPosition = storage.getObject(Position.class, new Request(
new Columns.All(), new Condition.Equals("id", event.getPositionId())));
- result.add(calculateTripOrStop(device, startPosition, endPosition, 0, ignoreOdometer, reportClass));
+ if (startPosition != null && endPosition != null) {
+ result.add(calculateTripOrStop(
+ device, startPosition, endPosition, 0, ignoreOdometer, reportClass));
+ }
startEvent = null;
}
}