sw/source/core/layout/wsfrm.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
New commits: commit 11a5a54567da8e85673aa48740ce7af08cba6016 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Tue Jul 5 16:47:10 2022 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Tue Jul 5 21:13:41 2022 +0200 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/+/136768 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> 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; } }