From cfe381e3ee55b8291faeea55fe3b67bb9e545d60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 29 Dec 2018 21:52:39 +0100 Subject: Properly handle empty TOC in XML output. Caused the test (079) to fail with a SIGSEGV, but larger projects exit with a success return code and the generated XML is either truncated or empty. Weird. --- src/xmlgen.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index bacf4d4..033e611 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -1818,10 +1818,10 @@ static void generateXMLForPage(PageDef *pd,FTextStream &ti,bool isExample) } } writeInnerPages(pd->getSubPages(),t); - if (pd->localToc().isXmlEnabled()) + SectionDict *sectionDict = pd->getSectionDict(); + if (pd->localToc().isXmlEnabled() && sectionDict) { t << " " << endl; - SectionDict *sectionDict = pd->getSectionDict(); SDict::Iterator li(*sectionDict); SectionInfo *si; int level=1,l; -- cgit v0.12