diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c index bc7591a3d75f427bc19630710f5391f4519a8504..007fdd87bba4b2b3c4f0d7bf8f42ad1af08643c5 100644 --- a/gtk/gtkpaned.c +++ b/gtk/gtkpaned.c @@ -1995,7 +1995,7 @@ gtk_paned_set_focus_child (GtkWidget *widget, /* If there is one or more paned widgets between us and the * focus widget, we want the topmost of those as last_focus */ - for (w = last_focus; w != GTK_WIDGET (paned); w = gtk_widget_get_parent (w)) + for (w = last_focus; (w != NULL) && (w != GTK_WIDGET (paned)); w = gtk_widget_get_parent (w)) if (GTK_IS_PANED (w)) last_focus = w;