From bb3a6bbb3b905287f94575fc3c65e44887b0ff58 Mon Sep 17 00:00:00 2001 From: John-Mark Bell Date: Sun, 11 Nov 2012 11:23:43 +0000 Subject: Permit hotlist entries to have no title. --- desktop/tree_url_node.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'desktop/tree_url_node.c') diff --git a/desktop/tree_url_node.c b/desktop/tree_url_node.c index 8cc3e0546..609765137 100644 --- a/desktop/tree_url_node.c +++ b/desktop/tree_url_node.c @@ -502,7 +502,7 @@ static void tree_url_load_entry(dom_node *li, tree_url_load_ctx *ctx) } derror = dom_node_get_text_content(a, &title1); - if (derror != DOM_NO_ERR || title1 == NULL) { + if (derror != DOM_NO_ERR) { warn_user("TreeLoadError", "(No title)"); dom_node_unref(a); return; @@ -516,18 +516,20 @@ static void tree_url_load_entry(dom_node *li, tree_url_load_ctx *ctx) return; } - title = strndup(dom_string_data(title1), - dom_string_byte_length(title1)); + if (title1 != NULL) { + title = strndup(dom_string_data(title1), + dom_string_byte_length(title1)); + dom_string_unref(title1); + } else { + title = strdup(""); + } if (title == NULL) { warn_user("NoMemory", NULL); dom_string_unref(url1); - dom_string_unref(title1); dom_node_unref(a); return; } - dom_string_unref(title1); - /* We're loading external input. * This may be garbage, so attempt to normalise via nsurl */ -- cgit v1.2.3