From 5e0b8b7980e26c66985abe9ade7e471266d91bae Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 2 Oct 2014 20:43:07 +0100 Subject: coverity#704994 Dereference after null check Change-Id: I19f98152b5bd8c9b2cdfacb560d13fc0c1f8c4be --- sw/source/filter/writer/writer.cxx | 9 ++++----- 1 file 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; -- cgit