From 8c4540e82cac92a732fd328d12e2f002c44362f9 Mon Sep 17 00:00:00 2001 From: crudo Date: Fri, 24 Mar 2017 21:08:32 +0100 Subject: [PATCH] Fix exception raising on 'event list' command when event has no transactions. --- cli.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cli.py b/cli.py index fdb4315..d7c6106 100755 --- a/cli.py +++ b/cli.py @@ -23,7 +23,10 @@ def get_total(transaction): def get_income(event): - return sum(get_total(t) for t in event.transactions) + if event.transactions: + return sum(get_total(t) for t in event.transactions) + else: + return 0 @click.group()