diff --git a/qulice-checkstyle/src/main/java/com/qulice/checkstyle/DiamondOperatorCheck.java b/qulice-checkstyle/src/main/java/com/qulice/checkstyle/DiamondOperatorCheck.java index 10b77c1c1..0688405a6 100644 --- a/qulice-checkstyle/src/main/java/com/qulice/checkstyle/DiamondOperatorCheck.java +++ b/qulice-checkstyle/src/main/java/com/qulice/checkstyle/DiamondOperatorCheck.java @@ -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"); } } @@ -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