提交 e998c2a6 编写于 作者: S Stephen Connolly

[FIX JENKINS-21303] There is a NPE here that can and does happen for real when...

[FIX JENKINS-21303] There is a NPE here that can and does happen for real when an aggresive slave retention strategy interacts with post build triggers that want to do token macro expansion
上级 bbe36a5a
...@@ -358,10 +358,12 @@ public abstract class Job<JobT extends Job<JobT, RunT>, RunT extends Run<JobT, R ...@@ -358,10 +358,12 @@ public abstract class Job<JobT extends Job<JobT, RunT>, RunT extends Run<JobT, R
public EnvVars getEnvironment(Node node, TaskListener listener) throws IOException, InterruptedException { public EnvVars getEnvironment(Node node, TaskListener listener) throws IOException, InterruptedException {
EnvVars env; EnvVars env;
if (node!=null) if (node!=null) {
env = node.toComputer().buildEnvironment(listener); final Computer computer = node.toComputer();
else env = (computer != null) ? computer.buildEnvironment(listener) : new EnvVars();
} else {
env = new EnvVars(); env = new EnvVars();
}
env.putAll(getCharacteristicEnvVars()); env.putAll(getCharacteristicEnvVars());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册