From bec28033628473bdfde0c5a9e1af522613968051 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 23 Oct 2014 16:39:45 +0100 Subject: coverity#704558 Dereference after null check Change-Id: I6fe44d8926acd185bb6bc671fb7df8ae935998c1 --- basic/source/comp/exprnode.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'basic') diff --git a/basic/source/comp/exprnode.cxx b/basic/source/comp/exprnode.cxx index e245fef19382..4340848bf66e 100644 --- a/basic/source/comp/exprnode.cxx +++ b/basic/source/comp/exprnode.cxx @@ -240,13 +240,12 @@ void SbiExprNode::CollectBits() // If a twig can be converted, True will be returned. In this case // the result is in the left twig. - void SbiExprNode::FoldConstants() { if( IsOperand() || eTok == LIKE ) return; if( pLeft ) pLeft->FoldConstants(); - if( pRight ) + if (pLeft && pRight) { pRight->FoldConstants(); if( pLeft->IsConstant() && pRight->IsConstant() @@ -419,7 +418,7 @@ void SbiExprNode::FoldConstants() } } } - else if( pLeft && pLeft->IsNumber() ) + else if (pLeft && pLeft->IsNumber()) { nVal = pLeft->nVal; delete pLeft; -- cgit v1.2.3