From: Thibaut Cuvelier Date: Sun, 20 Feb 2022 20:30:39 +0000 (+0100) Subject: DocBook, InsetFloat: avoid a potential nullptr dereference when detecting the type... X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=cfb6f205fa59a7989958ac2808e5a3c62f1b35bf;hp=bfe98181169d9e697e515da974d9b6a15a06c940;p=features.git DocBook, InsetFloat: avoid a potential nullptr dereference when detecting the type of table for filler content. --- diff --git a/src/insets/InsetFloat.cpp b/src/insets/InsetFloat.cpp index cb05e49aa6..981d61155a 100644 --- a/src/insets/InsetFloat.cpp +++ b/src/insets/InsetFloat.cpp @@ -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.