diff options
author | Carlos Soriano <csoriano@gnome.org> | 2016-03-03 16:34:37 +0100 |
---|---|---|
committer | Carlos Soriano <csoriano@gnome.org> | 2016-03-03 16:53:15 +0100 |
commit | 6721483eb713915b2fb07cf8dc830bdea3211fd3 (patch) | |
tree | f2ed215ae3c32ec41b97f537109f277bf741f75b /src/nautilus-shell-search-provider.c | |
parent | 40b4a07fbb42da4ed665e2de972b8386938f0df6 (diff) | |
download | nautilus-6721483eb713915b2fb07cf8dc830bdea3211fd3.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
Diffstat (limited to 'src/nautilus-shell-search-provider.c')
-rw-r--r-- | src/nautilus-shell-search-provider.c | 3 |
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); |