summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2023-02-07 12:42:09 +0000
committerMatthias Clasen <mclasen@redhat.com>2023-02-07 12:42:09 +0000
commit970072ef65da5e98a4b04a3df7da544a98ddd98d (patch)
treeb09bc0c4920afbb56b68e29965a90096c1d79e58
parent8a74770ec1d8d95f50c082fecf1b086eb84bace4 (diff)
parentf8321029fc65c7b80261cad132dda8af29609b86 (diff)
downloadgtk+-970072ef65da5e98a4b04a3df7da544a98ddd98d.tar.gz
Merge branch 'file-dialog-fixes' into 'main'
filedialog: Robustness fixes See merge request GNOME/gtk!5485
-rw-r--r--gtk/gtkfilechoosernativeportal.c2
-rw-r--r--gtk/gtkfiledialog.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/gtk/gtkfilechoosernativeportal.c b/gtk/gtkfilechoosernativeportal.c
index 8c5903ce30..254e62fd95 100644
--- a/gtk/gtkfilechoosernativeportal.c
+++ b/gtk/gtkfilechoosernativeportal.c
@@ -207,7 +207,7 @@ send_close (FilechooserPortalData *data)
message = g_dbus_message_new_method_call (PORTAL_BUS_NAME,
PORTAL_OBJECT_PATH,
- PORTAL_FILECHOOSER_INTERFACE,
+ PORTAL_REQUEST_INTERFACE,
"Close");
g_dbus_message_set_body (message,
g_variant_new ("(o)", data->portal_handle));
diff --git a/gtk/gtkfiledialog.c b/gtk/gtkfiledialog.c
index 84c038c457..8b9fc21a6a 100644
--- a/gtk/gtkfiledialog.c
+++ b/gtk/gtkfiledialog.c
@@ -694,7 +694,7 @@ gtk_file_dialog_set_initial_file (GtkFileDialog *self,
GFile *folder;
GFileInfo *info;
- if (g_file_equal (self->initial_file, file))
+ if (self->initial_file && g_file_equal (self->initial_file, file))
return;
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_INITIAL_FILE]);
@@ -707,7 +707,7 @@ gtk_file_dialog_set_initial_file (GtkFileDialog *self,
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_INITIAL_FOLDER]);
info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME, 0, NULL, NULL);
- if (g_file_info_get_edit_name (info) != NULL)
+ if (info && g_file_info_get_edit_name (info) != NULL)
{
if (g_set_str (&self->initial_name, g_file_info_get_edit_name (info)))
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_INITIAL_NAME]);
@@ -724,7 +724,7 @@ gtk_file_dialog_set_initial_file (GtkFileDialog *self,
g_free (name);
g_free (relative);
}
- g_object_unref (info);
+ g_clear_object (&info);
g_object_unref (folder);
}
else