summaryrefslogtreecommitdiff
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-20 16:15:19 +0100
commit5b02e3cecf522f9780175557d691eaff09a09e71 (patch)
tree1b6eddb2577bf87756b424ad5255119f559a2dd2
parent6ae439973eec5758ecbd582a21c383a7e5203894 (diff)
downloadnautilus-5b02e3cecf522f9780175557d691eaff09a09e71.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
-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 *