summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2023-03-07 20:54:31 -0500
committerMatthias Clasen <mclasen@redhat.com>2023-03-07 20:54:31 -0500
commitbc42955a138795896f11b1c7c4b37170f25cf616 (patch)
treec7b8c400948805e277439cc80a1330a92eb33dc5 /gtk
parentcdc008763bf70745f3f6ef122ee74c47458b03b8 (diff)
downloadgtk+-bc42955a138795896f11b1c7c4b37170f25cf616.tar.gz
filechooser: Handle pathless files
g_file_get_path() can return NULL. Make our getter for file locations handle that case. Related: !5610
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkfilechooserwidget.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index 0c29b31076..9f084a6e77 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -2061,6 +2061,9 @@ file_chooser_get_location (GtkFileChooserWidget *impl,
else
location = g_file_get_path (dir_location);
+ if (!location)
+ location = g_strdup ("");
+
g_clear_object (&dir_location);
g_clear_object (&home_location);