gnucash maint: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Tue Aug 31 15:56:38 EDT 2021


Updated	 via  https://github.com/Gnucash/gnucash/commit/9b30a232 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/86c438dc (commit)
	 via  https://github.com/Gnucash/gnucash/commit/52715fac (commit)
	from  https://github.com/Gnucash/gnucash/commit/ac5650a9 (commit)



commit 9b30a2327bb129bd2c032937573db8b247113e34
Merge: ac5650a9a 86c438dcf
Author: John Ralls <jralls at ceridwen.us>
Date:   Tue Aug 31 12:54:53 2021 -0700

    Merge Chris Good's 'MaintGenTrnImpMatFixCrash' into maint.


commit 86c438dcf4ba9492af0a32fac953b5b6b865f598
Author: goodvibes2 <goodchris96 at gmail.com>
Date:   Tue Aug 31 10:06:42 2021 +1000

    Fix unneeded double call to get_action_for_path()
    
    in gnc_gen_trans_onButtonPressed_cb().

diff --git a/gnucash/import-export/import-main-matcher.c b/gnucash/import-export/import-main-matcher.c
index 83e5a7f6e..ff779eeae 100644
--- a/gnucash/import-export/import-main-matcher.c
+++ b/gnucash/import-export/import-main-matcher.c
@@ -973,7 +973,6 @@ gnc_gen_trans_onButtonPressed_cb (GtkTreeView *treeview,
                 GList* selected;
                 GtkTreeModel *model;
                 selected = gtk_tree_selection_get_selected_rows (selection, &model);
-                get_action_for_path (selected->data, model);
                 if (get_action_for_path (selected->data, model) == GNCImport_ADD)
                     gnc_gen_trans_view_popup_menu (treeview, event, info);
                 g_list_free_full (selected, (GDestroyNotify)gtk_tree_path_free);

commit 52715face7808f7f3bd3ab590a5feaa2c8516a0b
Author: goodvibes2 <goodchris96 at gmail.com>
Date:   Tue Aug 31 09:53:38 2021 +1000

    Fix 2 crashes in Generic Transaction Matcher
    
    Both dumped core in gnc_import_TransInfo_get_action() because info
    is null
    1. After double clicking on a potential match line, then right clicking
    on the the parent transaction of the potential match
    2. After rubber banding a group of transactions which also includes an
    expanded potential match. Sometimes also need to right click the
    selection to trigger the core dump.

diff --git a/gnucash/import-export/import-main-matcher.c b/gnucash/import-export/import-main-matcher.c
index dca451efb..83e5a7f6e 100644
--- a/gnucash/import-export/import-main-matcher.c
+++ b/gnucash/import-export/import-main-matcher.c
@@ -867,6 +867,10 @@ get_action_for_path (GtkTreePath* path, GtkTreeModel *model)
     GtkTreeIter iter;
     gtk_tree_model_get_iter (model, &iter, path);
     gtk_tree_model_get (model, &iter, DOWNLOADED_COL_DATA, &trans_info, -1);
+    if (!trans_info)
+          // selected row is a potential match  (depth 2)
+          // instead of an imported transaction (depth 1)
+          return GNCImport_INVALID_ACTION;
     return gnc_import_TransInfo_get_action (trans_info);
 }
 



Summary of changes:
 gnucash/import-export/import-main-matcher.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)



More information about the gnucash-changes mailing list