summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-07-05 15:51:21 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2022-07-05 16:49:33 +0200
commita5d25a06a48b32fd35148265f3c328a28d21f73e (patch)
tree5dcb50a4ce5e2b7f6e9e98604bab5d3b58fcd890
parent46ae4bea931a969feb82c9fce048c7893249ba23 (diff)
sfx2: fix null derefs of SfxViewFrame::Current()
See https://crashreport.libreoffice.org/stats/signature/%60anonymous%20namespace'::lcl_tryLoadBibliography Change-Id: I80d764c4bbcf0c5affa3386fbb11f5a79e98b699 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136828 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--sfx2/source/appl/appserv.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index ed08854e6db6..43dd78314201 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -186,8 +186,10 @@ namespace
SfxStringItem aURL(SID_FILE_NAME, ".component:Bibliography/View1");
SfxStringItem aRef(SID_REFERER, "private:user");
SfxStringItem aTarget(SID_TARGETNAME, "_blank");
- SfxViewFrame::Current()->GetDispatcher()->ExecuteList(SID_OPENDOC,
- SfxCallMode::ASYNCHRON, { &aURL, &aRef, &aTarget });
+ const SfxViewFrame* pViewFrame = SfxViewFrame::Current();
+ if ( pViewFrame )
+ pViewFrame->GetDispatcher()->ExecuteList(SID_OPENDOC,
+ SfxCallMode::ASYNCHRON, { &aURL, &aRef, &aTarget });
}
catch (const Exception &)
{