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>
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index 03761b0..019da24 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -1297,6 +1297,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;