Add null check at output artifact resolution
The resolve method of OutputArtifactResolver may return a null object which needs to be handled before calling the listFiles method on it to avoid NPE.
@@ -138,6 +138,12 @@ class GeneratedResourceClassifier {
FileOperationProvider fileOperationProvider) {
File resDirectory =
OutputArtifactResolver.resolve(project, artifactLocationDecoder, artifactLocation);
+ if (resDirectory == null) {
+ logger.warn(
+ "Output artifact resolved to null. Artifact location: "
+ + artifactLocation.getRelativePath());
+ return GenResourceClassification.uninteresting(artifactLocation, 0);
+ }
File[] children = fileOperationProvider.listFiles(resDirectory);
if (children == null) {
return GenResourceClassification.uninteresting(artifactLocation, 0);
