Skip to content

Commit 818e081

Browse files
authored
Merge pull request #377 from maven-nar/feature/fix-NPE-res-build
Fix NPE msvc .res build
2 parents 48af679 + 1856ac3 commit 818e081

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/main/java/com/github/maven_nar/cpptasks/CCTask.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,11 @@ private BuildException runTargetPool(final CCTaskProgressMonitor monitor, BuildE
994994
if (compileException == null && exception instanceof BuildException) {
995995
compileException = (BuildException) exception;
996996
} else {
997-
log(cores[j].getName() + " " + exception + " ", Project.MSG_ERR);
997+
log(cores[j].getName() + " " + exception + " ", Project.MSG_ERR);
998+
final StackTraceElement[] stackTrace = exception.getStackTrace();
999+
for (final StackTraceElement element : stackTrace) {
1000+
log(element.toString(),Project.MSG_DEBUG);
1001+
}
9981002
}
9991003
if (!this.relentless) {
10001004
cores[j] = null;

src/main/java/com/github/maven_nar/cpptasks/compiler/CommandLineCompiler.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,8 @@ protected int getTotalArgumentLengthForInputFile(final File outputDir, final Str
571571
* arguments without actually spawning the compiler
572572
*/
573573
protected int runCommand(final CCTask task, final File workingDir, final String[] cmdline) throws BuildException {
574-
commands.add(cmdline);
574+
if(commands!=null)
575+
commands.add(cmdline);
575576
if (dryRun) return 0;
576577
return CUtil.runCommand(task, workingDir, cmdline, this.newEnvironment, this.env);
577578
}

0 commit comments

Comments
 (0)