From a6e878c6fd6049bc491a6e586c91c53198339461 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()