summaryrefslogtreecommitdiff
path: root/scripting
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 /scripting
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 'scripting')
-rw-r--r--scripting/source/protocolhandler/scripthandler.cxx3
1 files changed, 1 insertions, 2 deletions
diff --git a/scripting/source/protocolhandler/scripthandler.cxx b/scripting/source/protocolhandler/scripthandler.cxx
index d05c34612c45..5aabb4654b0a 100644
--- a/scripting/source/protocolhandler/scripthandler.cxx
+++ b/scripting/source/protocolhandler/scripthandler.cxx
@@ -327,8 +327,7 @@ ScriptProtocolHandler::getScriptInvocation()
if ( pFrame->GetFrameInterface() == m_xFrame )
break;
}
- SfxObjectShell* pDocShell = pFrame ? pFrame->GetCurrentDocument() : SfxObjectShell::Current();
- if ( pDocShell )
+ if (SfxObjectShell* pDocShell = pFrame ? pFrame->GetCurrentDocument() : SfxObjectShell::Current())
{
Reference< XModel > xModel( pDocShell->GetModel() );
m_xScriptInvocation.set( xModel, UNO_QUERY );