diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-04-17 09:14:36 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-04-17 09:43:17 +0100 |
commit | 8721ae4f77587aa14032708638c2b5a63355a2c7 (patch) | |
tree | 74ab80fcf45cbe890f59cc036d92a2f06570e513 | |
parent | 6abeecc614f52cf8473d3fdae954eaa7ebf748ad (diff) |
coverity#705493 Dereference null return value
Change-Id: I20133ad19197fdfe40bb449680ac274ca0fa056e
-rw-r--r-- | sw/source/core/layout/pagechg.cxx | 13 |
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; |