summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Soriano <csoriano@gnome.org>2016-03-03 16:34:37 +0100
committerCarlos Soriano <csoriano@gnome.org>2016-03-03 16:50:14 +0100
commitf79bed6f4091e8b1497790760b952f5ef00dc60f (patch)
tree2ddd8e8b91b1dae87615723a06d1c3fcc0c06092
parente297bfc7ec5a2d130752e85f5e936aa185a76ad8 (diff)
downloadnautilus-f79bed6f4091e8b1497790760b952f5ef00dc60f.tar.gz
shell-search-provider: don't crash if file doesn't have path
Some backends doesn't support g_file_get_path, like the trash backends, and we were crashing trying to create a description with a NULL path. For those, just use the uri as a description. https://bugzilla.gnome.org/show_bug.cgi?id=762076
-rw-r--r--src/nautilus-shell-search-provider.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nautilus-shell-search-provider.c b/src/nautilus-shell-search-provider.c
index cec51c060..27963f0e0 100644
--- a/src/nautilus-shell-search-provider.c
+++ b/src/nautilus-shell-search-provider.c
@@ -546,8 +546,9 @@ result_list_attributes_ready_cb (GList *file_list,
"id", g_variant_new_string (uri));
g_variant_builder_add (&meta, "{sv}",
"name", g_variant_new_string (display_name));
+ /* Some backends like trash:/// don't have a path, so we show the uri itself. */
g_variant_builder_add (&meta, "{sv}",
- "description", g_variant_new_string (description));
+ "description", g_variant_new_string (description? description : uri));
gicon = NULL;
thumbnail_path = nautilus_file_get_thumbnail_path (file);