DocBook, InsetFloat: avoid a potential nullptr dereference when detecting the type of table for filler content.

This commit is contained in:
Thibaut Cuvelier 2022-02-20 21:30:39 +01:00
parent bfe9818116
commit cfb6f205fa

View File

@ -819,12 +819,15 @@ void docbookNoSubfigures(XMLStream & xs, OutputParams const & runparams, const I
}
// - Output the actual content of the float or some dummy content (to ensure that the output
// document is valid).
// document is valid). Use HTML tables by default, unless an InsetFloat is given.
if (hasFloat)
xs << XMLStream::ESCAPE_NONE << osFloatContent.str();
else if (ftype.docbookFloatType() == "table")
docbookGenerateFillerTable(xs, thisFloat->buffer().params().docbook_table_output);
else
else if (ftype.docbookFloatType() == "table") {
BufferParams::TableOutput tableFormat = BufferParams::HTMLTable;
if (thisFloat)
tableFormat = thisFloat->buffer().params().docbook_table_output;
docbookGenerateFillerTable(xs, tableFormat);
} else
docbookGenerateFillerMedia(xs);
// - Close the float.