summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2021-04-27 19:11:58 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2021-04-28 10:51:07 +0200
commitd12acfa1405fa5b7c11d2a517286da68b3fd2eff (patch)
tree253fa4b3e116a62c7cbc6c07ace14d2a7f12059c /sw/source
parent569a06656e926dfb26d55958ee0f696aa9e5b7b0 (diff)
sw: fix crash in SwFormatAutoFormat::dumpAsXml()
Change-Id: Ib2d723b34d8e6f1254f5a9b0d0be509daf24ce43 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114758 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/txtnode/atrfld.cxx5
-rw-r--r--sw/source/core/txtnode/fmtatr2.cxx5
2 files changed, 8 insertions, 2 deletions
diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx
index 36151899db9a..558874ad1784 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -410,7 +410,10 @@ void SwFormatField::dumpAsXml(xmlTextWriterPtr pWriter) const
(void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("mpTextField"), "%p", mpTextField);
SfxPoolItem::dumpAsXml(pWriter);
- mpField->dumpAsXml(pWriter);
+ if (mpField) // pool default doesn't have one
+ {
+ mpField->dumpAsXml(pWriter);
+ }
(void)xmlTextWriterEndElement(pWriter);
}
diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx
index ff04d9bb0ed9..73eb992c5c97 100644
--- a/sw/source/core/txtnode/fmtatr2.cxx
+++ b/sw/source/core/txtnode/fmtatr2.cxx
@@ -143,7 +143,10 @@ void SwFormatAutoFormat::dumpAsXml(xmlTextWriterPtr pWriter) const
(void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatAutoFormat"));
(void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
- mpHandle->dumpAsXml(pWriter);
+ if (mpHandle) // pool default doesn't have one
+ {
+ mpHandle->dumpAsXml(pWriter);
+ }
(void)xmlTextWriterEndElement(pWriter);
}