xmloff/source/core/xmlexp.cxx | 2 ++ 1 file changed, 2 insertions(+) New commits: commit c9f2ec93939417a120f26d64c2b2dff380e81286 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Sat Sep 7 18:26:09 2024 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Sat Sep 7 21:50:12 2024 +0200
xmloff: fix deref before null check Seen in https://crashreport.libreoffice.org/stats/signature/SvXMLExport::ExportThemeElement(std::shared_ptr%3Cmodel::Theme%3E%20const%20&) Change-Id: I12b9c3cf064100fb6cfeaaf2828dbf08e7dd8a81 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173000 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index d1ff0d0f7650..895386726c2a 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -1688,6 +1688,8 @@ void SvXMLExport::ExportThemeElement(std::shared_ptr<model::Theme> const& pTheme SvXMLElementExport aTheme(*this, XML_NAMESPACE_LO_EXT, XML_THEME, true, true); auto pColorSet = pTheme->getColorSet(); + if (!pColorSet) + return; if (!pColorSet->getName().isEmpty()) AddAttribute(XML_NAMESPACE_LO_EXT, XML_NAME, pColorSet->getName()); SvXMLElementExport aColorTable(*this, XML_NAMESPACE_LO_EXT, XML_THEME_COLORS, true, true);