From 4bdb31c35e0862b99d9aff0c3432aad460f87fcc Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Sun, 28 May 2023 13:04:40 +1000 Subject: [PATCH] austax: Fail gracefully when PAGYW account does not exist --- austax/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/austax/__init__.py b/austax/__init__.py index 5dfcd19..c38eab1 100644 --- a/austax/__init__.py +++ b/austax/__init__.py @@ -80,7 +80,7 @@ def make_tax_transactions(): # PAYG withholding for account_name, kinds in account_configurations.items(): if 'austax.paygw' in kinds: - if accounts[account_name].quantity != 0: + if account_name in accounts and accounts[account_name].quantity != 0: # Transfer balance to Income Tax Control transactions.append(Transaction( dt=dt,