Skip to content

Commit

Permalink
Bug 798395 ofxdirectconnect downloads crash gnucash 4.9
Browse files Browse the repository at this point in the history
Add a check of temp_trans_list to avoid dereferencing a NULL pointer when there
are no transactions to match. Add a dialog to alert the user.
  • Loading branch information
jeanlaroche committed Jan 4, 2022
1 parent 8d92517 commit 1cbc70b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gnucash/import-export/import-main-matcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,11 @@ gnc_gen_trans_list_show_all (GNCImportMainMatcher *info)
// Set initial state of Append checkbox to same as last import for this account.
// Get the import account from the first split in first transaction.
temp_trans_list = info->temp_trans_list;
if (!temp_trans_list)
{
gnc_info_dialog (GTK_WINDOW (info->main_widget), _("While importing transactions found no new transactions."));
return;
}
trans_info = temp_trans_list->data;
first_split = gnc_import_TransInfo_get_fsplit (trans_info);
account = xaccSplitGetAccount(first_split);
Expand Down

0 comments on commit 1cbc70b

Please sign in to comment.