Skip to content

Commit

Permalink
Merge pull request iandees#8 from rwilson-releaseapp/master
Browse files Browse the repository at this point in the history
Fix index error when a new service (or one that doesn't have yesterday's cost)
  • Loading branch information
iandees authored Oct 5, 2020
2 parents f3a98d9 + 9d21b82 commit 9f0c92f
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 9f0c92f

Please sign in to comment.