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:16:55 +0100
commita4ef903f2302bdc96798d843f369eef432160e11 (patch)
tree87154f4db2d2ad62322c9ea0c0194078e2c18487
parent849e613091ef3a9017921cf8dfa8738eef96a899 (diff)
downloadnautilus-a4ef903f2302bdc96798d843f369eef432160e11.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 8a58529d4..96cf3e79a 100644
--- a/libnautilus-private/nautilus-file.c
+++ b/libnautilus-private/nautilus-file.c
@@ -3744,8 +3744,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 *