aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-05-28 11:29:34 -0700
committerAnton Tananaev <anton@traccar.org>2022-05-28 11:29:34 -0700
commitb9d7cbe6f15b471b0edff49870fef8190949ad09 (patch)
tree942c3a78792315cdb40b6b5c33253e15a0d0b3e7 /src/main/java/org/traccar
parentbcd8d095de5e5b99dec3420ddd91419a0a3ba238 (diff)
downloadtrackermap-server-b9d7cbe6f15b471b0edff49870fef8190949ad09.tar.gz
trackermap-server-b9d7cbe6f15b471b0edff49870fef8190949ad09.tar.bz2
trackermap-server-b9d7cbe6f15b471b0edff49870fef8190949ad09.zip
Ignore empty summary records
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r--src/main/java/org/traccar/reports/Summary.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/reports/Summary.java b/src/main/java/org/traccar/reports/Summary.java
index 4924af062..f00b1ca57 100644
--- a/src/main/java/org/traccar/reports/Summary.java
+++ b/src/main/java/org/traccar/reports/Summary.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 - 2020 Anton Tananaev (anton@traccar.org)
+ * Copyright 2016 - 2022 Anton Tananaev (anton@traccar.org)
* Copyright 2016 Andrey Kunitsyn (andrey@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -127,7 +127,12 @@ public final class Summary {
ArrayList<SummaryReport> result = new ArrayList<>();
for (long deviceId: ReportUtils.getDeviceList(deviceIds, groupIds)) {
Context.getPermissionsManager().checkDevice(userId, deviceId);
- result.addAll(calculateSummaryResults(userId, deviceId, from, to, daily));
+ Collection<SummaryReport> deviceResults = calculateSummaryResults(userId, deviceId, from, to, daily);
+ for (SummaryReport summaryReport : deviceResults) {
+ if (summaryReport.getStartTime() != null && summaryReport.getEndTime() != null) {
+ result.add(summaryReport);
+ }
+ }
}
return result;
}