Skip to content

Commit

Permalink
Fixes #354 NullPointerException
Browse files Browse the repository at this point in the history
Fixes #354 NullPointerException in AvoidNotShortCircuitOperatorsForBooleanCheck
  • Loading branch information
oyarzun authored and romani committed Sep 7, 2015
1 parent e746395 commit 7053187
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -116,12 +116,12 @@ public final void visitToken(final DetailAST detailAST)

DetailAST currentNode = detailAST;
// look for EXPR which is always around BOR/BAND... operators
while (currentNode.getType() != TokenTypes.EXPR)
while (currentNode != null && currentNode.getType() != TokenTypes.EXPR)
{
currentNode = currentNode.getParent();
}

if (isBooleanExpression(currentNode)) {
if (currentNode != null && isBooleanExpression(currentNode)) {
log(detailAST, MSG_KEY, detailAST.getText());
}

Expand Down

0 comments on commit 7053187

Please sign in to comment.