Skip to content

Commit

Permalink
#1198 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Mar 7, 2024
1 parent add4e1e commit cbc8b1c
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -107,7 +107,7 @@ public void visitToken(final DetailAST node) {
DiamondOperatorCheck.findFirstChildNodeOfType(
instance, TokenTypes.TYPE_ARGUMENTS
);
if (!DiamondOperatorCheck.isDiamondOperatorUsed(type)) {
if (type != null && !DiamondOperatorCheck.isDiamondOperatorUsed(type)) {
log(type, "Use diamond operator");
}
}
Expand Down Expand Up @@ -150,7 +150,7 @@ private static boolean isDiamondOperatorUsed(final DetailAST node) {
*
* @param node AST subtree to process.
* @param type Type of token
* @return Child node of specified type
* @return Child node of specified type OR NULL!
*/
private static DetailAST findFirstChildNodeOfType(
final DetailAST node, final int type
Expand Down

0 comments on commit cbc8b1c

Please sign in to comment.