summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/core/layout/pagechg.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 4b66fbf320a6..3b714b813fd6 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -725,12 +725,15 @@ SwPageDesc *SwPageFrm::FindPageDesc()
if( pSh && pSh->GetViewOptions()->getBrowseMode() )
{
SwCntntFrm *pFrm = GetUpper()->ContainsCntnt();
- while ( !pFrm->IsInDocBody() )
+ while (pFrm && !pFrm->IsInDocBody())
pFrm = pFrm->GetNextCntntFrm();
- SwFrm *pFlow = pFrm;
- if ( pFlow->IsInTab() )
- pFlow = pFlow->FindTabFrm();
- pRet = (SwPageDesc*)pFlow->GetAttrSet()->GetPageDesc().GetPageDesc();
+ if (pFrm)
+ {
+ SwFrm *pFlow = pFrm;
+ if ( pFlow->IsInTab() )
+ pFlow = pFlow->FindTabFrm();
+ pRet = (SwPageDesc*)pFlow->GetAttrSet()->GetPageDesc().GetPageDesc();
+ }
if ( !pRet )
pRet = &GetFmt()->GetDoc()->GetPageDesc( 0 );
return pRet;