Protect against null run process customizer

See 0ee277b8c3
See gh-32607
This commit is contained in:
Andy Wilkinson 2022-10-06 11:55:41 +01:00
parent 1a2cf837d9
commit 188cac6540
1 changed files with 3 additions and 1 deletions

View File

@ -65,7 +65,9 @@ class JavaProcessExecutor {
int run(File workingDirectory, List<String> args, Map<String, String> environmentVariables)
throws MojoExecutionException {
RunProcess runProcess = new RunProcess(workingDirectory, getJavaExecutable());
this.runProcessCustomizer.accept(runProcess);
if (this.runProcessCustomizer != null) {
this.runProcessCustomizer.accept(runProcess);
}
try {
int exitCode = runProcess.run(true, args, environmentVariables);
if (!hasTerminatedSuccessfully(exitCode)) {