diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-07-05 16:47:10 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2023-07-17 11:52:16 +0200 |
commit | 635fbb4d2958730c0f3ae2bd525bc7f06fea6f73 (patch) | |
tree | 84deda121e05000e6db1e98f77d2b6f6cda2bdf3 | |
parent | f243c0fd9a1d9a0885046e43b125daf5b5e269ff (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>
(cherry picked from commit f5ca3291e4f2c25fbff49301d6f3a7ed0017a708)
-rw-r--r-- | sw/source/core/layout/wsfrm.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index d1a54738812b..e92fb0391f74 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -1205,13 +1205,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; } } |