diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-07-05 15:51:21 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2022-07-07 12:33:16 +0200 |
commit | 54d40fef93f1194bf29440cf66a567c9fc612158 (patch) | |
tree | 3c5be943fa29a7b75932520b329824c7e0e8443f /sfx2 | |
parent | 3788d8be31764a3f44dc662f2d6e040a2a24510e (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/+/136767
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/appserv.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 107b8c1f749a..741d3f2cbafd 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 &) { |