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>
  • Loading branch information...
oleg-nenashev committed Nov 13, 2013
1 parent a865a52 commit ef943a3ee69529a9f41353f134043ed3363f12e0
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 ef943a3

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