diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2020-10-12 14:13:18 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-12 14:13:18 -0700 |
commit | 7d48ebdcf44346d75715fb146aaa9e26501ea3b6 (patch) | |
tree | 673f01d303712b079937a1afb847efbaba722585 /src/main/java/org/traccar | |
parent | 852c87ba428274772ffc29cfe4ec9920184f4c38 (diff) | |
parent | c92e60e464da718bf65638bfe514d0fa0192769a (diff) | |
download | trackermap-server-7d48ebdcf44346d75715fb146aaa9e26501ea3b6.tar.gz trackermap-server-7d48ebdcf44346d75715fb146aaa9e26501ea3b6.tar.bz2 trackermap-server-7d48ebdcf44346d75715fb146aaa9e26501ea3b6.zip |
Merge pull request #4580 from lukasha12/master
Fixing distance calculation condition
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r-- | src/main/java/org/traccar/reports/ReportUtils.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/reports/ReportUtils.java b/src/main/java/org/traccar/reports/ReportUtils.java index 9a22b5f9b..af686ba20 100644 --- a/src/main/java/org/traccar/reports/ReportUtils.java +++ b/src/main/java/org/traccar/reports/ReportUtils.java @@ -97,7 +97,7 @@ public final class ReportUtils { double firstOdometer = firstPosition.getDouble(Position.KEY_ODOMETER); double lastOdometer = lastPosition.getDouble(Position.KEY_ODOMETER); - if (useOdometer && (firstOdometer != 0.0 || lastOdometer != 0.0)) { + if (useOdometer && firstOdometer != 0.0 && lastOdometer != 0.0) { distance = lastOdometer - firstOdometer; } else if (firstPosition.getAttributes().containsKey(Position.KEY_TOTAL_DISTANCE) && lastPosition.getAttributes().containsKey(Position.KEY_TOTAL_DISTANCE)) { |