From e12d87eea4df6844d32b564a7840111d8acaf49f Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Mon, 15 May 2017 20:45:02 +0100 Subject: Fix crash in CHM output if a document has no title. Naturally, after calling the previous commit '1.2', someone had to instantly find a bug that shows up in the simplest possible example Halibut invocation :-( --- bk_html.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bk_html.c b/bk_html.c index 784e3ca..f6b7f4b 100644 --- a/bk_html.c +++ b/bk_html.c @@ -1887,8 +1887,9 @@ static void html_backend_common(paragraph *sourceform, keywordlist *keywords, ho_setup_rdstringc(&ho, &rs); ho.hacklimit = 255; - html_words(&ho, topsect->title->words, NOTHING, - NULL, keywords, &conf); + if (topsect->title) + html_words(&ho, topsect->title->words, NOTHING, + NULL, keywords, &conf); rdaddc(&rs, '\0'); chm_title(chm, rs.text); @@ -2027,8 +2028,9 @@ static void html_backend_common(paragraph *sourceform, keywordlist *keywords, "Title="); ho.hacklimit = 255; - html_words(&ho, topsect->title->words, NOTHING, - NULL, keywords, &conf); + if (topsect->title) + html_words(&ho, topsect->title->words, NOTHING, + NULL, keywords, &conf); ho_string(&ho, "\n"); -- cgit v1.1