diff --git a/ynab.py b/ynab.py index 890a6a7..4025a74 100755 --- a/ynab.py +++ b/ynab.py @@ -29,7 +29,16 @@ def convert(reader, writer): money_out = 0 money_in = 0 - money = float(row[3].replace(',', '.')) + if (isinstance(row[3], str)): + moneystr = row[3].replace(',', '.') + + try: + money = float(moneystr) if moneystr else 0 + except ValueError as e: + print(f'Error in row {row}') + raise e + else: + money = float(row[3]) if money >= 0: money_in = money