Skip to content
Permalink
Browse files

[FIXED JENKINS-20559] - ProcStarter: Check for null before cloning of…

… environment variables list

Resolves https://issues.jenkins-ci.org/browse/JENKINS-20559
BTW, I also need to add some tests to "Test Harness" in order to improve coverage of nested operations.
These test require a fix for https://issues.jenkins-ci.org/browse/JENKINS-19454

Signed-off-by: Oleg Nenashev <nenashev@synopsys.com>
(cherry picked from commit ef943a3)
  • Loading branch information...
oleg-nenashev authored and olivergondza committed Nov 13, 2013
1 parent eedf51e commit 1273668ba3b47fd344405ba4c49ec5a83ea9b508
Showing with 6 additions and 1 deletion.
  1. +6 −1 core/src/main/java/hudson/Launcher.java
@@ -300,8 +300,13 @@ public ProcStarter envs(String... overrides) {
return this;
}

/**
* Gets a list of environment variables to be set.
* Returns an empty array if envs field has not been initialized.
* @return If initialized, returns a copy of internal envs array. Otherwise - a new empty array.
*/
public String[] envs() {
return envs.clone();
return envs != null ? envs.clone() : new String[0];
}

/**

0 comments on commit 1273668

Please sign in to comment.
You can’t perform that action at this time.