summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2023-04-13 15:50:25 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2023-04-26 13:27:34 +0200
commit72f598e4b6f5250f250a3f3cce82e059f4fae34f (patch)
treebd50e0281a80454284aad7659ad1890dbed4bf12
parentofz#57592 Null-dereference READ (diff)
downloadcore-72f598e4b6f5250f250a3f3cce82e059f4fae34f.tar.gz
core-72f598e4b6f5250f250a3f3cce82e059f4fae34f.zip
Resolves: tdf#152619 crash inspecting uninserted XFieldMaster
Change-Id: I765dd5d7e1ed2c1749841491a50216a6afe903c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150351 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 5464a1dad69c52d011b194baf7d543ce8dd27748) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150503 Reviewed-by: Stéphane Guillou <stephane.guillou@libreoffice.org> Tested-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--sw/source/core/unocore/unofield.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index 84ae8fe2d8f5..c6d899d2c9f2 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -1325,6 +1325,8 @@ SwXTextField::getTextFieldMaster()
SolarMutexGuard aGuard;
SwFieldType* pType = m_pImpl->GetFieldType();
+ if (!pType && !m_pImpl->m_pDoc) // tdf#152619
+ return nullptr;
uno::Reference<beans::XPropertySet> const xRet(
SwXFieldMaster::CreateXFieldMaster(m_pImpl->m_pDoc, pType));
return xRet;