Skip to content

Commit

Permalink
[FIXED JENKINS-20559] - ProcStarter: Check for null before cloning of…
Browse files Browse the repository at this point in the history
… 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 Jul 2, 2014
1 parent eedf51e commit 1273668
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/src/main/java/hudson/Launcher.java
Expand Up @@ -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];
}

/**
Expand Down

0 comments on commit 1273668

Please sign in to comment.