xmloff/source/core/xmlexp.cxx | 2 ++
1 file changed, 2 insertions(+)
New commits:
commit b6b5afddaf32c988ab5c63ee9e10c9de2b7d7e7b
Author: Xisco Fauli <[email protected]>
AuthorDate: Sat Sep 7 18:26:09 2024 +0200
Commit: Michael Stahl <[email protected]>
CommitDate: Mon Sep 9 13:11:14 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 <[email protected]>
(cherry picked from commit c9f2ec93939417a120f26d64c2b2dff380e81286)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173010
Reviewed-by: Michael Stahl <[email protected]>
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index bb7ef1cc695d..3f1d0667b3c4 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -1689,6 +1689,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);