tdf#125382: Check if pDoc is not null

regression from e18359445fabad9ba1a704600e9ee327112cc6ae

Change-Id: Icd8db6a403b7736d6c8c9d40c8f2c7476c1eee87
Reviewed-on: https://gerrit.libreoffice.org/74533
Tested-by: Jenkins
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index 3c31a11..7759844 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -1182,6 +1182,9 @@

    SwFieldType* GetFieldType() const
    {
        if(!m_pDoc)
            throw uno::RuntimeException();

        if (IsDescriptor())
            return m_pFieldType;
        return m_pFormatField->GetField()->GetTyp();
@@ -1363,6 +1366,7 @@
SwXTextField::getTextFieldMaster()
{
    SolarMutexGuard aGuard;

    SwFieldType* pType = m_pImpl->GetFieldType();
    uno::Reference<beans::XPropertySet> const xRet(
            SwXFieldMaster::CreateXFieldMaster(m_pImpl->m_pDoc, pType));