Skip to content

Commit

Permalink
Fix index error when a new service (or one that doesn't have yesterda…
Browse files Browse the repository at this point in the history
…y's cost)
  • Loading branch information
rwilson-release committed Oct 5, 2020
1 parent f3a98d9 commit 9d21b82
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def sparkline(datapoints):
return line

def delta(costs):
if (costs[-1] >= 1 and costs[-2] >= 1):
if (len(costs) > 1 and costs[-1] >= 1 and costs[-2] >= 1):
# This only handles positive numbers
result = ((costs[-1]/costs[-2])-1)*100.0
else:
Expand Down

0 comments on commit 9d21b82

Please sign in to comment.