Skip to content

Commit

Permalink
Do not fail if any of the statement line dates is None
Browse files Browse the repository at this point in the history
  • Loading branch information
kedder committed Nov 20, 2020
1 parent e99cf82 commit 9462acd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ofxstatement/statement.py
Expand Up @@ -287,5 +287,5 @@ def recalculate_balance(stmt: Statement) -> None:

stmt.start_balance = stmt.start_balance or D(0)
stmt.end_balance = stmt.start_balance + total_amount
stmt.start_date = min(sl.date for sl in stmt.lines)
stmt.end_date = max(sl.date for sl in stmt.lines)
stmt.start_date = min(sl.date for sl in stmt.lines if sl.date is not None)
stmt.end_date = max(sl.date for sl in stmt.lines if sl.date is not None)

0 comments on commit 9462acd

Please sign in to comment.