[nautilus] nautilus_file_peek_display_name: Don't return NULL
- From: Iain Lane <iainl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] nautilus_file_peek_display_name: Don't return NULL
- Date: Tue, 20 Oct 2015 15:13:43 +0000 (UTC)
commit 3fb7cff1a86d0a4ca48877ebcd8f27ef43a2edbd
Author: Iain Lane <iain orangesquash org uk>
Date: Mon Oct 19 15:31:33 2015 +0100
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
libnautilus-private/nautilus-file.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c
index 193edcb..eff26dc 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 *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]