You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by kw...@apache.org on 2022/12/08 15:50:45 UTC

[jackrabbit-filevault-package-maven-plugin] branch master updated: fix NPE

This is an automated email from the ASF dual-hosted git repository.

kwin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jackrabbit-filevault-package-maven-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new e5236ef  fix NPE
e5236ef is described below

commit e5236ef4e1b526ef2a9a03e10e5220b3bda59a7e
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Thu Dec 8 16:50:40 2022 +0100

    fix NPE
---
 .../jackrabbit/filevault/maven/packaging/mojo/ValidateFilesMojo.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/jackrabbit/filevault/maven/packaging/mojo/ValidateFilesMojo.java b/src/main/java/org/apache/jackrabbit/filevault/maven/packaging/mojo/ValidateFilesMojo.java
index d1554e7..3945da9 100644
--- a/src/main/java/org/apache/jackrabbit/filevault/maven/packaging/mojo/ValidateFilesMojo.java
+++ b/src/main/java/org/apache/jackrabbit/filevault/maven/packaging/mojo/ValidateFilesMojo.java
@@ -199,13 +199,13 @@ public class ValidateFilesMojo extends AbstractValidateMojo {
             getLog().info("Validate files in generatedMetaInfRootDirectory " + getProjectRelativeFilePath(generatedMetaInfRootDirectory.toPath()) + " and metaInfRootDir " + getProjectRelativeFilePath(generatedMetaInfRootDirectory.toPath()));
             File jcrSourceDirectory = AbstractSourceAndMetadataPackageMojo.getJcrSourceDirectory(jcrRootSourceDirectory, builtContentDirectory, getLog());
             final Path packageRootDirectory;
-            if (jcrSourceDirectory != null) {
+            if (jcrSourceDirectory == null) {
                 // just return path of non-existing directory
                 packageRootDirectory = jcrRootSourceDirectory[0].toPath().getParent();
             } else {
                 packageRootDirectory = jcrSourceDirectory.getParentFile().toPath();
             }
-            ValidationContext context = new DirectoryValidationContext(buildContext.isIncremental(), generatedMetaInfRootDirectory.toPath(), metaInfRootDirectory.toPath(), packageRootDirectory, resolver, getLog());
+            ValidationContext context = new DirectoryValidationContext(buildContext.isIncremental(), generatedMetaInfRootDirectory.toPath(), metaInfRootDirectory != null ? metaInfRootDirectory.toPath() : null, packageRootDirectory, resolver, getLog());
             ValidationExecutor executor = validationExecutorFactory.createValidationExecutor(context, false, false, getEffectiveValidatorSettingsForPackage(context.getProperties().getId(), false));
             if (executor == null) {
                 throw new MojoExecutionException("No registered validators found!");