mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-14 04:22:16 +00:00
fixed #1006 --- NPE in launching a process without alterning env variables.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@5875 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
767eb31f0b
commit
402da21bae
1 file changed
+7
-5
@@ -83,11 +83,13 @@ public abstract class Proc {
|
||||
}
|
||||
|
||||
private static ProcessBuilder environment(ProcessBuilder pb, String[] env) {
|
||||
Map<String, String> m = pb.environment();
|
||||
m.clear();
|
||||
for (String e : env) {
|
||||
int idx = e.indexOf('=');
|
||||
m.put(e.substring(0,idx),e.substring(idx+1,e.length()));
|
||||
if(env!=null) {
|
||||
Map<String, String> m = pb.environment();
|
||||
m.clear();
|
||||
for (String e : env) {
|
||||
int idx = e.indexOf('=');
|
||||
m.put(e.substring(0,idx),e.substring(idx+1,e.length()));
|
||||
}
|
||||
}
|
||||
return pb;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user