diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-10-02 20:43:07 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-10-03 09:07:55 +0100 |
commit | 5e0b8b7980e26c66985abe9ade7e471266d91bae (patch) | |
tree | 68b8fa479327a64e7a42618f0dfed357a70d83e8 | |
parent | 9d6c648d5478c2c45eb9333adad098d6768a91c2 (diff) |
coverity#704994 Dereference after null check
Change-Id: I19f98152b5bd8c9b2cdfacb560d13fc0c1f8c4be
-rw-r--r-- | sw/source/filter/writer/writer.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sw/source/filter/writer/writer.cxx b/sw/source/filter/writer/writer.cxx index 700d18b193fb..ce8aaa66c219 100644 --- a/sw/source/filter/writer/writer.cxx +++ b/sw/source/filter/writer/writer.cxx @@ -207,11 +207,10 @@ Writer::NewSwPaM(SwDoc & rDoc, sal_uLong const nStartIdx, sal_uLong const nEndId SwPaM* pNew = new SwPaM( aStt ); pNew->SetMark(); aStt = nEndIdx; - if( 0 == (pCNode = aStt.GetNode().GetCntntNode()) && - 0 == (pCNode = pNds->GoPrevious( &aStt )) ) - { - OSL_FAIL( "No more ContentNode at StartPos" ); - } + pCNode = aStt.GetNode().GetCntntNode(); + if (!pCNode) + pCNode = pNds->GoPrevious(&aStt); + assert(pCNode && "No more ContentNode at StartPos"); pCNode->MakeEndIndex( &pNew->GetPoint()->nContent ); pNew->GetPoint()->nNode = aStt; return pNew; |