From 64dedccfe32d8b9620e0df87a992e1fdc74b531b Mon Sep 17 00:00:00 2001 From: Christian Stimming Date: Sun, 20 Sep 2020 21:04:16 +0200 Subject: [PATCH] [HBCI] Fix crashing aqbanking balance download and import Also, clarify the preconditions of the import-matcher functions. Follow-up to d4fe5841203e6ebdeb1162b76c91026df1d3e034 --- gnucash/import-export/aqb/gnc-ab-utils.c | 6 ++++-- gnucash/import-export/import-main-matcher.c | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gnucash/import-export/aqb/gnc-ab-utils.c b/gnucash/import-export/aqb/gnc-ab-utils.c index a84d4d7ed3..f903e6cbb4 100644 --- a/gnucash/import-export/aqb/gnc-ab-utils.c +++ b/gnucash/import-export/aqb/gnc-ab-utils.c @@ -1245,7 +1245,8 @@ gnc_ab_import_context(AB_IMEXPORTER_CONTEXT *context, data); /* populate and display the matching window */ - gnc_gen_trans_list_show_all(data->generic_importer); + if (data->generic_importer) + gnc_gen_trans_list_show_all(data->generic_importer); /* Check balances */ if (!(awaiting & IGNORE_BALANCES)) @@ -1258,7 +1259,8 @@ gnc_ab_import_context(AB_IMEXPORTER_CONTEXT *context, data); /* populate and display the matching window */ - gnc_gen_trans_list_show_all(data->generic_importer); + if (data->generic_importer) + gnc_gen_trans_list_show_all(data->generic_importer); /* Check balances */ if (!(awaiting & IGNORE_BALANCES)) diff --git a/gnucash/import-export/import-main-matcher.c b/gnucash/import-export/import-main-matcher.c index 46d7db3807..85cd1feb18 100644 --- a/gnucash/import-export/import-main-matcher.c +++ b/gnucash/import-export/import-main-matcher.c @@ -388,6 +388,7 @@ resolve_conflicts (GNCImportMainMatcher *info) void gnc_gen_trans_list_show_all(GNCImportMainMatcher *info) { + g_assert (info); gnc_gen_trans_list_create_matches (info); resolve_conflicts (info); gtk_widget_show_all (GTK_WIDGET (info->main_widget)); @@ -1807,7 +1808,9 @@ gnc_gen_trans_list_create_matches (GNCImportMainMatcher *gui) GHashTable* account_hash = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, (GDestroyNotify)g_slist_free); - GList *candidate_txns = query_imported_transaction_accounts (gui); + GList *candidate_txns; + g_assert (gui); + candidate_txns = query_imported_transaction_accounts (gui); create_hash_of_potential_matches (candidate_txns, account_hash); perform_matching (gui, account_hash);