diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/NonStaticImport.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/NonStaticImport.java index cbd89c5cdf2..6c1b7b743e6 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/NonStaticImport.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/NonStaticImport.java @@ -116,7 +116,7 @@ public NonStaticImport() {} @Override public Description matchIdentifier(IdentifierTree tree, VisitorState state) { Symbol symbol = ASTHelpers.getSymbol(tree); - if (!isMatch(symbol, state)) { + if (symbol == null || !isMatch(symbol, state)) { return Description.NO_MATCH; }