summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-04-17 09:14:36 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-04-17 09:43:17 +0100
commit8721ae4f77587aa14032708638c2b5a63355a2c7 (patch)
tree74ab80fcf45cbe890f59cc036d92a2f06570e513
parent6abeecc614f52cf8473d3fdae954eaa7ebf748ad (diff)
coverity#705493 Dereference null return value
Change-Id: I20133ad19197fdfe40bb449680ac274ca0fa056e
-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;