From 6bfcdcc8640cac20900383dd38b55cfe9225a567 Mon Sep 17 00:00:00 2001 From: jcardus Date: Sat, 1 Jun 2024 01:59:59 +0100 Subject: check time > 0 in speed filter --- src/main/java/org/traccar/handler/FilterHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/org/traccar/handler/FilterHandler.java b/src/main/java/org/traccar/handler/FilterHandler.java index 3bb7ef426..700fdbc13 100644 --- a/src/main/java/org/traccar/handler/FilterHandler.java +++ b/src/main/java/org/traccar/handler/FilterHandler.java @@ -153,7 +153,7 @@ public class FilterHandler extends BasePositionHandler { if (filterMaxSpeed != 0 && last != null) { double distance = position.getDouble(Position.KEY_DISTANCE); double time = position.getFixTime().getTime() - last.getFixTime().getTime(); - return UnitsConverter.knotsFromMps(distance / (time / 1000)) > filterMaxSpeed; + return time > 0 && UnitsConverter.knotsFromMps(distance / (time / 1000)) > filterMaxSpeed; } return false; } -- cgit v1.2.3