diff --git a/financeplanner/views.py b/financeplanner/views.py index b5b9fab..6e5e225 100644 --- a/financeplanner/views.py +++ b/financeplanner/views.py @@ -96,7 +96,10 @@ def _floor_to_first_two_places(dec): def _calculate_scale(stats): - max_amount = max(stat["amount"] for stat in stats.values() if stat["amount"] is not None) + amounts = [stat["amount"] for stat in stats.values() if stat["amount"] is not None] + if not amounts: + return 100 + max_amount = max(amounts) return _floor_to_first_two_places(max_amount * Decimal("1.3"))