filechooserwidget: gtk_widget_get_root() can return NULL

This commit is contained in:
Timm Bäder 2020-10-15 06:56:58 +02:00
parent a2291fb989
commit 3db5e15bde

View File

@ -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;
}