summaryrefslogtreecommitdiff
path: root/libnautilus-private
diff options
context:
space:
mode:
authorIain Lane <iain@orangesquash.org.uk>2015-10-19 15:31:33 +0100
committerIain Lane <iain@orangesquash.org.uk>2015-10-19 16:49:05 +0100
commit3fb7cff1a86d0a4ca48877ebcd8f27ef43a2edbd (patch)
tree1ed3d4dc4a92a98d21bb956b59bb0cd918693f2b /libnautilus-private
parentf61e6c062b2de7ca8b07a232d3c621280736ff76 (diff)
downloadnautilus-3fb7cff1a86d0a4ca48877ebcd8f27ef43a2edbd.tar.gz
nautilus_file_peek_display_name: Don't return NULL
If the name is the empty string then nautilus_file_set_display_name won't actually set the display name. In this case we were returning NULL from nautilus_file_peek_display_name, which some of our callers weren't prepared to handle. This led to crashes. https://bugzilla.gnome.org/show_bug.cgi?id=700507
Diffstat (limited to 'libnautilus-private')
-rw-r--r--libnautilus-private/nautilus-file.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c
index 193edcbc6..eff26dcc0 100644
--- a/libnautilus-private/nautilus-file.c
+++ b/libnautilus-private/nautilus-file.c
@@ -3742,8 +3742,9 @@ nautilus_file_peek_display_name (NautilusFile *file)
g_free (escaped_name);
}
}
-
- return eel_ref_str_peek (file->details->display_name);
+
+ return file->details->display_name ?
+ eel_ref_str_peek (file->details->display_name) : "";
}
char *