summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2023-02-09 14:36:51 +0100
committerCaolán McNamara <caolanm@redhat.com>2023-02-09 21:05:54 +0000
commit10ed0b5c09eefc53c8e8a6f606faf29dac5f4d80 (patch)
tree98aac9ebab33bde51bf8c621ca7ece353f897a1e
parent6ed7a3cc51e560c6b2a6894f6829c0ac9f991ef2 (diff)
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 <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/source/uibase/app/applab.cxx2
1 files changed, 2 insertions, 0 deletions
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.