diff options
author | Matthias Clasen <mclasen@redhat.com> | 2023-03-07 20:54:31 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2023-03-07 20:54:31 -0500 |
commit | bc42955a138795896f11b1c7c4b37170f25cf616 (patch) | |
tree | c7b8c400948805e277439cc80a1330a92eb33dc5 | |
parent | cdc008763bf70745f3f6ef122ee74c47458b03b8 (diff) | |
download | gtk+-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
-rw-r--r-- | gtk/gtkfilechooserwidget.c | 3 |
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); |