diff options
author | Timm Bäder <mail@baedert.org> | 2020-10-15 06:56:58 +0200 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2020-10-22 17:46:33 +0200 |
commit | 3db5e15bde8d677537cff6f44b44f353f63d3c3a (patch) | |
tree | b1c561b18c9d98491ee152791a27abe1f3024d0f /gtk/gtkfilechooserwidget.c | |
parent | a2291fb989537e47aa02bdeaba0f8458e25a2928 (diff) | |
download | gtk+-3db5e15bde8d677537cff6f44b44f353f63d3c3a.tar.gz |
filechooserwidget: gtk_widget_get_root() can return NULL
Diffstat (limited to 'gtk/gtkfilechooserwidget.c')
-rw-r--r-- | gtk/gtkfilechooserwidget.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c index 50b9f6033e..171301a24b 100644 --- a/gtk/gtkfilechooserwidget.c +++ b/gtk/gtkfilechooserwidget.c @@ -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; } |