sw/source/uibase/app/applab.cxx |    2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 72e99627fedc65084ff0aff29b0b54a224a77fab
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Thu Feb 9 14:36:51 2023 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Fri Feb 10 10:54:25 2023 +0000

    sw: fix crash in SwModule::InsertLab
    
    Seen in 
https://crashreport.libreoffice.org/stats/crash_details/e17357e9-d5e2-4eee-868e-ecf72e04dc41
    
    Change-Id: I32f239249e72b6644b3a38d4dd9bbae65f7bede0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146708
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    Tested-by: Jenkins

diff --git a/sw/source/uibase/app/applab.cxx b/sw/source/uibase/app/applab.cxx
index 1ea666ccdf61..7ee421ed5ee7 100644
--- a/sw/source/uibase/app/applab.cxx
+++ b/sw/source/uibase/app/applab.cxx
@@ -181,6 +181,8 @@ void SwModule::InsertLab(SfxRequest& rReq, bool bLabel)
     }
 
     SfxViewFrame* pViewFrame = SfxViewFrame::DisplayNewDocument( *xDocSh, rReq 
);
+    if (!pViewFrame)
+        return;
 
     SwView      *pNewView = static_cast<SwView*>( pViewFrame->GetViewShell());
     pNewView->AttrChangedNotify(nullptr);// So that SelectShell is being 
called.

Reply via email to