From 1856ac3562d853270b55fce93d68bab5b8640a50 Mon Sep 17 00:00:00 2001 From: Greg Domjan Date: Fri, 23 Jul 2021 12:29:36 +1000 Subject: [PATCH] Fix NPE for building resource dryRun command tracking not initialized unclear on assumption of commands being initialized --- .../maven_nar/cpptasks/compiler/CommandLineCompiler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/maven_nar/cpptasks/compiler/CommandLineCompiler.java b/src/main/java/com/github/maven_nar/cpptasks/compiler/CommandLineCompiler.java index 0b17175ba..c1f4f506d 100644 --- a/src/main/java/com/github/maven_nar/cpptasks/compiler/CommandLineCompiler.java +++ b/src/main/java/com/github/maven_nar/cpptasks/compiler/CommandLineCompiler.java @@ -571,7 +571,8 @@ protected int getTotalArgumentLengthForInputFile(final File outputDir, final Str * arguments without actually spawning the compiler */ protected int runCommand(final CCTask task, final File workingDir, final String[] cmdline) throws BuildException { - commands.add(cmdline); + if(commands!=null) + commands.add(cmdline); if (dryRun) return 0; return CUtil.runCommand(task, workingDir, cmdline, this.newEnvironment, this.env); }