sfx2/source/appl/appserv.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 9e25ab14713a31746a9a8a62649b046606ae04b2
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Tue Jul 5 15:51:21 2022 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Jul 5 21:17:18 2022 +0200

    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/+/136766
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 66ac22ee133a..ee603ab5e097 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 &)
         {

Reply via email to