gnucash maint: [HBCI] Fix crashing aqbanking balance download and import

Christian Stimming cstim at code.gnucash.org
Sun Sep 20 15:18:07 EDT 2020


Updated	 via  https://github.com/Gnucash/gnucash/commit/64dedccf (commit)
	from  https://github.com/Gnucash/gnucash/commit/3d7e66d9 (commit)



commit 64dedccfe32d8b9620e0df87a992e1fdc74b531b
Author: Christian Stimming <christian at cstimming.de>
Date:   Sun Sep 20 21:04:16 2020 +0200

    [HBCI] Fix crashing aqbanking balance download and import
    
    Also, clarify the preconditions of the import-matcher functions.
    Follow-up to d4fe5841203e6ebdeb1162b76c91026df1d3e034

diff --git a/gnucash/import-export/aqb/gnc-ab-utils.c b/gnucash/import-export/aqb/gnc-ab-utils.c
index a84d4d7ed..f903e6cbb 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 46d7db380..85cd1feb1 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);



Summary of changes:
 gnucash/import-export/aqb/gnc-ab-utils.c    | 6 ++++--
 gnucash/import-export/import-main-matcher.c | 5 ++++-
 2 files changed, 8 insertions(+), 3 deletions(-)



More information about the gnucash-changes mailing list