mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Prevent running off the end of the GncOptionUI widget's parent tree.
This commit is contained in:
parent
b361582cf2
commit
7392ac6fcf
@ -228,9 +228,16 @@ gnc_option_get_gtk_widget (const GncOption* option)
|
||||
static void
|
||||
dialog_changed_internal (GtkWidget *widget, bool sensitive)
|
||||
{
|
||||
while (widget && !GTK_IS_WINDOW(widget))
|
||||
widget = gtk_widget_get_parent(widget);
|
||||
if (!widget) return;
|
||||
g_return_if_fail(widget);
|
||||
while (TRUE)
|
||||
{
|
||||
auto new_widget = gtk_widget_get_parent(widget);
|
||||
if (new_widget && GTK_IS_WIDGET(new_widget) &&
|
||||
GTK_IS_WINDOW(new_widget))
|
||||
widget = new_widget;
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
/* find the ok and cancel buttons, we know where they will be so do it
|
||||
this way as opposed to using gtk_container_foreach, much less iteration */
|
||||
|
Loading…
Reference in New Issue
Block a user