summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source')
-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 e30e3ecc401a..2834b09f70a6 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -1232,10 +1232,11 @@ void SwContentFrame::Cut()
// RemoveSuperfluous can only remove empty pages at the end;
// find if there are pages without content following pPage
// and if so request a call to CheckPageDescs()
- SwPageFrame const* pNext(pPage);
SwViewShell *pSh = pRoot->GetCurrShell();
- if (pSh && pSh->Imp()->IsAction())
+ // tdf#152983 pPage is null when called from SwHeadFootFrame ctor
+ if (pPage && pSh && pSh->Imp()->IsAction())
{
+ SwPageFrame const* pNext(pPage);
while ((pNext = static_cast<SwPageFrame const*>(pNext->GetNext())))
{
if (!sw::IsPageFrameEmpty(*pNext) && !pNext->IsFootnotePage())