summaryrefslogtreecommitdiff
path: root/sw/source/ui/fldui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-12-16 12:11:38 +0000
committerCaolán McNamara <caolanm@redhat.com>2022-12-16 21:17:15 +0000
commit1726c27e0d633ab04843834d2bf987bc7645807f (patch)
tree7810a18cd5bc3bf5aa345b816b372d93bd323974 /sw/source/ui/fldui
parent1ae71d8f09771ba7180be6ebdf89d36a31eb8625 (diff)
check SfxObjectShell::Current()
SfxObjectShell::Current() can return null, it's based on the equally vile SfxViewFrame::Current() Change-Id: Ia5c7783680e9d8e5d3075078f16a2c15cb6f7a47 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144339 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/ui/fldui')
-rw-r--r--sw/source/ui/fldui/fldedt.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/ui/fldui/fldedt.cxx b/sw/source/ui/fldui/fldedt.cxx
index 6e0ca5caf07e..e4f5824f9ad9 100644
--- a/sw/source/ui/fldui/fldedt.cxx
+++ b/sw/source/ui/fldui/fldedt.cxx
@@ -187,8 +187,8 @@ SfxTabPage* SwFieldEditDlg::CreatePage(sal_uInt16 nGroup)
xTabPage = SwFieldRefPage::Create(get_content_area(), this, nullptr);
break;
case GRP_REG:
+ if (SfxObjectShell* pDocSh = SfxObjectShell::Current())
{
- SfxObjectShell* pDocSh = SfxObjectShell::Current();
auto pSet = new SfxItemSetFixed<FN_FIELD_DIALOG_DOC_PROPS, FN_FIELD_DIALOG_DOC_PROPS>( pDocSh->GetPool() );
using namespace ::com::sun::star;
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
@@ -200,8 +200,8 @@ SfxTabPage* SwFieldEditDlg::CreatePage(sal_uInt16 nGroup)
uno::UNO_QUERY_THROW);
pSet->Put( SfxUnoAnyItem( FN_FIELD_DIALOG_DOC_PROPS, uno::Any(xUDProps) ) );
xTabPage = SwFieldDokInfPage::Create(get_content_area(), this, pSet);
- break;
}
+ break;
#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS
case GRP_DB:
xTabPage = SwFieldDBPage::Create(get_content_area(), this, nullptr);