diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-09-14 16:27:22 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-09-14 16:27:57 +0100 |
commit | 188696a20a4bd480db79135551a4307e63f745a5 (patch) | |
tree | 29342e80d09acd82931cae2ca8b33350f05aa389 | |
parent | b7912ec63cdb4757b53a37661a56b600fcc96d87 (diff) |
don't crash
-rw-r--r-- | sw/source/core/crsr/crsrsh.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 7339aba81000..6278e620a865 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -614,7 +614,8 @@ SwFrm* lcl_IsInHeaderFooter( const SwNodeIndex& rIdx, Point& rPt ) SwCntntNode* pCNd = rIdx.GetNode().GetCntntNode(); if( pCNd ) { - pFrm = pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &rPt, 0, sal_False )->GetUpper(); + SwCntntFrm *pCntFrm = pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &rPt, 0, sal_False ); + pFrm = pCntFrm ? pCntFrm->GetUpper() : NULL; while( pFrm && !pFrm->IsHeaderFrm() && !pFrm->IsFooterFrm() ) pFrm = pFrm->IsFlyFrm() ? ((SwFlyFrm*)pFrm)->AnchorFrm() : pFrm->GetUpper(); |