aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
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;
}
}