sw/source/uibase/app/applab.cxx | 2 ++ 1 file changed, 2 insertions(+)
New commits: commit 10ed0b5c09eefc53c8e8a6f606faf29dac5f4d80 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Thu Feb 9 14:36:51 2023 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Thu Feb 9 21:05:54 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/+/146692 Tested-by: Jenkins Tested-by: Caolán McNamara <caol...@redhat.com> Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/source/uibase/app/applab.cxx b/sw/source/uibase/app/applab.cxx index 786e9bf63d4c..dbcacc997cb2 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.