diff options
-rw-r--r-- | fietsboek/views/profile.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fietsboek/views/profile.py b/fietsboek/views/profile.py index 81ec16d..e73df42 100644 --- a/fietsboek/views/profile.py +++ b/fietsboek/views/profile.py @@ -97,6 +97,8 @@ class CumulativeStats: @property def avg_speed(self) -> float: """Average speed, in m/s.""" + if not self.moving_time: + return 0.0 return self.length / self.moving_time.total_seconds() |