From 3cc1d1b2e0331ca8bcdc0a1df49308cf9635565e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Wed, 26 Jan 2022 19:53:05 +0100 Subject: [PATCH] Fix NPE --- .../pmd/lang/java/rule/design/CouplingBetweenObjectsRule.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/CouplingBetweenObjectsRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/CouplingBetweenObjectsRule.java index 59227777e6..dfea612724 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/CouplingBetweenObjectsRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/CouplingBetweenObjectsRule.java @@ -106,7 +106,7 @@ public class CouplingBetweenObjectsRule extends AbstractJavaRule { * @param typeNode The variable type. */ private void checkVariableType(ASTType typeNode) { - if (inInterface) { + if (inInterface || typeNode == null) { return; } // if the field is of any type other than the class type