From d57ce63ad7dc2bc61d05980e984408f1b63ff59d Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Mon, 31 Dec 2018 14:47:44 +0100 Subject: Issue 6714: Don't crash or generate invalid XML for empty TOC --- src/xmlgen.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index bacf4d4..44061f6 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 (sectionDict && pd->localToc().isXmlEnabled()) { t << " " << endl; - SectionDict *sectionDict = pd->getSectionDict(); SDict::Iterator li(*sectionDict); SectionInfo *si; int level=1,l; -- cgit v0.12