Skip to content

Commit

Permalink
Prevent crash when an account has no transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
davidstosik committed Jul 14, 2024
1 parent d74efc7 commit 7ad9244
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/mfynab/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ def start
next
end

# Skip if no transactions were found for this account
next unless @mf_data.key?(mapping["money_forward_name"])

transactions = @mf_data[mapping["money_forward_name"]].map do |row|
import_id = "MFBY:v1:#{row["id"]}"
memo = "#{row["category"]}/#{row["subcategory"]} - #{row["content"]} - #{row["memo"]}"
Expand Down

0 comments on commit 7ad9244

Please sign in to comment.