diff --git a/app/tools.py b/app/tools.py index 08771b5..90a1cb2 100644 --- a/app/tools.py +++ b/app/tools.py @@ -38,7 +38,9 @@ class ConsumableStats: for pitstop in pitstops: self.overall_amount += pitstop.amount self.amounts.append(StatsEvent(pitstop.date, pitstop.amount)) - self.price.append(StatsEvent(pitstop.date, pitstop.costs/pitstop.amount)) + # some pitstops seem to have lost their costs... + if pitstop.costs: + self.price.append(StatsEvent(pitstop.date, pitstop.costs/pitstop.amount)) self.average_amount_fuelled = self.overall_amount / pitstop_count if pitstop_count > 1: overall_distance = (