gnucash stable: Check that the register completioncell tree view is realized before trying to scroll to point

Robert Fewell bobit at code.gnucash.org
Sun Aug 6 06:44:41 EDT 2023


Updated	 via  https://github.com/Gnucash/gnucash/commit/0a9e999c (commit)
	from  https://github.com/Gnucash/gnucash/commit/0bd34a01 (commit)



commit 0a9e999cfd9f0f4c19cf8c1b79c9c8c1285af542
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sun Aug 6 11:37:25 2023 +0100

    Check that the register completioncell tree view is realized before trying to scroll to point

diff --git a/gnucash/register/register-gnome/completioncell-gnome.c b/gnucash/register/register-gnome/completioncell-gnome.c
index ff3729d72c..697d662b52 100644
--- a/gnucash/register/register-gnome/completioncell-gnome.c
+++ b/gnucash/register/register-gnome/completioncell-gnome.c
@@ -170,6 +170,9 @@ text_width (PangoLayout *layout)
 static void
 horizontal_scroll_to_found_text (PopBox* box, char* item_string, gint found_location)
 {
+    if (!gtk_widget_get_realized (GTK_WIDGET(box->item_list->tree_view)))
+        return;
+
     GtkAllocation alloc;
     gtk_widget_get_allocation (GTK_WIDGET(box->item_list->tree_view), &alloc);
     gint scroll_point = 0;



Summary of changes:
 gnucash/register/register-gnome/completioncell-gnome.c | 3 +++
 1 file changed, 3 insertions(+)



More information about the gnucash-changes mailing list