gnucash maint: Multiple changes pushed

Christopher Lam clam at code.gnucash.org
Thu Mar 10 17:48:17 EST 2022


Updated	 via  https://github.com/Gnucash/gnucash/commit/3939aeff (commit)
	 via  https://github.com/Gnucash/gnucash/commit/8fa197ee (commit)
	from  https://github.com/Gnucash/gnucash/commit/c1001e66 (commit)



commit 3939aeff4bf1e75a943008ffbbb2d1b50a993dd8
Merge: c1001e664 8fa197eeb
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Fri Mar 11 06:47:16 2022 +0800

    Merge branch 'maint-progress0' into maint #1286


commit 8fa197eebf1e5775fb4a2f0fc06aee01347bc15a
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Wed Mar 2 15:04:26 2022 +0800

    [gnc-budget-view] total_nodes may be exhausted. assign NULL.
    
    the refactor in 8cef481e1 introduced a crasher -- in the line
    
    totals_view_col = gtk_tree_view_get_column (priv->totals_tree_view, j);
    
    j would occasionally exceed the number of columns available in the
    GtkTreeView and the function would return NULL. This change restores
    this behaviour.
    
    I found that switching preference Account -> Default currency radio
    buttons would trigger this crasher. To illustrate, add the following
    tracer immediately after assigning totals_view_col.
    
    PWARN ("tree_view_col=%p, totals_view_col=%p", tree_view_col, totals_view_col)

diff --git a/gnucash/gnome/gnc-budget-view.c b/gnucash/gnome/gnc-budget-view.c
index 3a0c24c07..a7dfdf5b9 100644
--- a/gnucash/gnome/gnc-budget-view.c
+++ b/gnucash/gnome/gnc-budget-view.c
@@ -884,7 +884,7 @@ gbv_treeview_resized_cb (GtkWidget *widget, GtkAllocation *allocation,
         if ((g_strcmp0 (name, "description") == 0) && (!priv->show_account_desc))
             total_node = g_list_next (total_node);
 
-        if (gtk_tree_view_column_get_visible (tree_view_col))
+        if (gtk_tree_view_column_get_visible (tree_view_col) && total_node != NULL)
         {
             gint col_width = gtk_tree_view_column_get_width (tree_view_col);
             GtkTreeViewColumn *totals_view_col = total_node->data;



Summary of changes:
 gnucash/gnome/gnc-budget-view.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



More information about the gnucash-changes mailing list