From: Matthias Clasen Date: Wed, 8 Mar 2023 01:54:31 +0000 (-0500) Subject: filechooser: Handle pathless files X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~5^2~44^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=bc42955a138795896f11b1c7c4b37170f25cf616;p=gtk4.git filechooser: Handle pathless files g_file_get_path() can return NULL. Make our getter for file locations handle that case. Related: !5610 --- 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);