[gvfs] client: Return NULL if set_display_name() fails
- From: Ross Lagerwall <rossl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs] client: Return NULL if set_display_name() fails
- Date: Fri, 11 Apr 2014 16:52:40 +0000 (UTC)
commit a3d3074363cd271c94dd10606d7a9953625632da
Author: Ross Lagerwall <rosslagerwall gmail com>
Date: Tue Mar 25 08:32:25 2014 +0000
client: Return NULL if set_display_name() fails
Return NULL as per the documentation rather than returning the original
file. This prevents errors like the following, where "Permission
Denied" should be displayed:
$ gvfs-rename smb://localhost/tmp/cat dog
Rename successful. New uri: smb://localhost/tmp/cat
(gvfs-rename:1385): GLib-GObject-CRITICAL **: g_object_unref: assertion
'G_IS_OBJECT (object)' failed
https://bugzilla.gnome.org/show_bug.cgi?id=727007
client/gdaemonfile.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/client/gdaemonfile.c b/client/gdaemonfile.c
index 445c919..c3f8284 100644
--- a/client/gdaemonfile.c
+++ b/client/gdaemonfile.c
@@ -2381,6 +2381,8 @@ g_daemon_file_set_display_name (GFile *file,
if (g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
_g_dbus_send_cancelled_sync (g_dbus_proxy_get_connection (G_DBUS_PROXY (proxy)));
_g_propagate_error_stripped (error, local_error);
+
+ file = NULL;
}
g_free (path);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]