summaryrefslogtreecommitdiff
path: root/sw/source/core/layout/wsfrm.cxx
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-07-05 16:47:10 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2022-07-05 18:04:54 +0200
commitf5ca3291e4f2c25fbff49301d6f3a7ed0017a708 (patch)
tree61422bbae6fe72d60335349463f264647b109455 /sw/source/core/layout/wsfrm.cxx
parent92f531209675e1855798f513fb7698fceddd022b (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/+/136834 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/source/core/layout/wsfrm.cxx')
-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 e171ab8108be..1eadc9db6a6f 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;
}
}