From 188cac65400b0dea5c64fc2665780d6ae8251dff Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 6 Oct 2022 11:55:41 +0100 Subject: [PATCH] Protect against null run process customizer See 0ee277b8c3f3dc92e480c9b71169d54ef9b4c0f9 See gh-32607 --- .../org/springframework/boot/maven/JavaProcessExecutor.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/JavaProcessExecutor.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/JavaProcessExecutor.java index e12688621e..901734170e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/JavaProcessExecutor.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/JavaProcessExecutor.java @@ -65,7 +65,9 @@ class JavaProcessExecutor { int run(File workingDirectory, List args, Map 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)) {