summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2011-12-14 12:19:09 +0100
committerCosimo Cecchi <cosimoc@gnome.org>2011-12-14 12:28:53 +0100
commitc0752563fe6f2a0454069b93c9a29dae11a2e833 (patch)
tree2a37afc1610670f875478018b18086519576e956
parent8aa21c333115cec5eab0cd3965684b9b09dc7fa3 (diff)
downloadnautilus-c0752563fe6f2a0454069b93c9a29dae11a2e833.tar.gz
fdo-dbus: handle g_file_get_parent() failing
g_file_get_parent() can return NULL if the file is a root element. Handle that case gracefully in the code.
-rw-r--r--src/nautilus-freedesktop-dbus.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/nautilus-freedesktop-dbus.c b/src/nautilus-freedesktop-dbus.c
index b628a3a35..03dc7feca 100644
--- a/src/nautilus-freedesktop-dbus.c
+++ b/src/nautilus-freedesktop-dbus.c
@@ -86,10 +86,14 @@ skeleton_handle_show_items_cb (NautilusFreedesktopFileManager1 *object,
file = g_file_new_for_uri (uris[i]);
parent = g_file_get_parent (file);
- nautilus_application_open_location (fdb->application, parent, file, startup_id);
+ if (parent != NULL) {
+ nautilus_application_open_location (fdb->application, parent, file, startup_id);
+ g_object_unref (parent);
+ } else {
+ nautilus_application_open_location (fdb->application, file, NULL, startup_id);
+ }
g_object_unref (file);
- g_object_unref (parent);
}
nautilus_freedesktop_file_manager1_complete_show_items (object, invocation);