Skip to content
Permalink
Browse files
[FIXED JENKINS-11592] NPE in subversion polling of Maven jobs
  • Loading branch information
kutzi committed Nov 15, 2011
1 parent c9958b7 commit e2d7b399210db6333affd9a0e6deac5a94a4d300
Showing 2 changed files with 13 additions and 7 deletions.
@@ -55,6 +55,9 @@
<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class=bug>
Fixed NPE in Subversion polling of Maven jobs.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-11592">issue 11592</a>)
<li class=rfe>
CLI jar now has the version number in the manifest as well as the "-version" option.
</ul>
@@ -165,15 +165,18 @@ public EnvVars getEnvironment(TaskListener log) throws IOException, InterruptedE


mvn = mvn.forEnvironment(envs);
Node node = Computer.currentComputer().getNode();
if (node == null) {
log.getLogger().println("WARNING: cannot get current node: "+Computer.currentComputer());
return envs;

Computer computer = Computer.currentComputer();
if (computer != null) { // just in case were not in a build
Node node = computer.getNode();
if (node != null) {
mvn = mvn.forNode(node, log);

envs.put("M2_HOME", mvn.getHome());
envs.put("PATH+MAVEN", mvn.getHome() + "/bin");
}
}
mvn = mvn.forNode(node, log);

envs.put("M2_HOME", mvn.getHome());
envs.put("PATH+MAVEN", mvn.getHome() + "/bin");
return envs;
}

0 comments on commit e2d7b39

Please sign in to comment.