Skip to content

Commit 89150cd

Browse files
authored
Merge pull request #79 from phucyall/master
[JENKINS-36952] Don't set env. variable if it's null
2 parents 31b9da4 + 8279180 commit 89150cd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/org/jenkinsci/plugins/workflow/vSphereStep.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ protected String run() throws Exception {
122122
step.getBuildStep().getClass().toString().contains("Clone") ||
123123
step.getBuildStep().getClass().toString().contains("ExposeGuestInfo")) {
124124
IP = step.getBuildStep().getIP();
125-
envVars.put("VSPHERE_IP", IP);
125+
if (IP != null) {
126+
envVars.put("VSPHERE_IP", IP);
127+
}
126128

127129
if (step.getBuildStep().getClass().toString().contains("ExposeGuestInfo")) {
128130
Map<String, String> envVars = ((ExposeGuestInfo)step.getBuildStep()).getVars();
@@ -136,4 +138,4 @@ protected String run() throws Exception {
136138
return IP;
137139
}
138140
}
139-
}
141+
}

0 commit comments

Comments
 (0)