summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-07-05 16:47:10 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2022-07-08 11:46:54 +0200
commit0411e70f45d9b0ac05cad557b6b0c0f45952c279 (patch)
tree299c21a86e967a2e7c83710538b630583d45a5ba /sw
parent3f8c6e73bc23d3295ea97f204745cf1869272c66 (diff)
sw: fix null derefs of GetCurrShell()
See https://crashreport.libreoffice.org/stats/signature/SwContentFrame::Cut() Change-Id: I00267b480d9c123f68996572d2e6fdebc4fb383f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136769 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/layout/wsfrm.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index 43bd9a7037a1..65b9383543eb 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -1222,13 +1222,14 @@ void SwContentFrame::Cut()
// find if there are pages without content following pPage
// and if so request a call to CheckPageDescs()
SwPageFrame const* pNext(pPage);
- if (pRoot->GetCurrShell()->Imp()->IsAction())
+ SwViewShell *pSh = pRoot->GetCurrShell();
+ if (pSh && pSh->Imp()->IsAction())
{
while ((pNext = static_cast<SwPageFrame const*>(pNext->GetNext())))
{
if (!sw::IsPageFrameEmpty(*pNext) && !pNext->IsFootnotePage())
{
- pRoot->GetCurrShell()->Imp()->GetLayAction().SetCheckPageNum(pPage->GetPhyPageNum());
+ pSh->Imp()->GetLayAction().SetCheckPageNum(pPage->GetPhyPageNum());
break;
}
}