Add extra error handling in Nordigen balances

This commit is contained in:
Mark Veidemanis 2022-06-19 18:26:38 +01:00
parent 5b596ae4b5
commit 933642def6
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 3 additions and 0 deletions

View File

@ -450,6 +450,9 @@ class Nordigen(util.Base):
parsed = obj.to_dict() parsed = obj.to_dict()
total = 0 total = 0
currency = None currency = None
if "balances" not in parsed:
self.log.error(f"No balances: {parsed}")
return (False, False)
for entry in parsed["balances"]: for entry in parsed["balances"]:
if currency: if currency:
if not currency == entry["balanceAmount"]["currency"]: if not currency == entry["balanceAmount"]["currency"]: