forked from AuroraMiddleware/gtk
filechooserwidget: gtk_widget_get_root() can return NULL
This commit is contained in:
parent
a2291fb989
commit
3db5e15bde
@ -619,11 +619,11 @@ gtk_file_chooser_widget_finalize (GObject *object)
|
||||
static GtkWindow *
|
||||
get_toplevel (GtkWidget *widget)
|
||||
{
|
||||
GtkWidget *toplevel;
|
||||
GtkRoot *root;
|
||||
|
||||
toplevel = GTK_WIDGET (gtk_widget_get_root (widget));
|
||||
if (GTK_IS_WINDOW (toplevel))
|
||||
return GTK_WINDOW (toplevel);
|
||||
root = gtk_widget_get_root (widget);
|
||||
if (root && GTK_IS_WINDOW (root))
|
||||
return GTK_WINDOW (root);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user