diff --git a/pom.xml b/pom.xml
index 14d51486..9c611a0c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -9,7 +9,7 @@
envinject
- 1.92.0-beta-2-SNAPSHOT
+ 1.93-SNAPSHOT
hpi
Environment Injector Plugin
https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin
@@ -41,6 +41,15 @@
Maintainer
+
+ recena
+ Manuel Recena
+ recena@gmail.com
+ +1
+
+ Contributor
+
+
@@ -60,16 +69,17 @@
+
org.jenkins-ci.tools
maven-hpi-plugin
1.98
true
-
+
-
+
@@ -120,6 +130,6 @@
-
-
+
+
diff --git a/src/main/java/org/jenkinsci/plugins/envinject/EnvInjectComputerListener.java b/src/main/java/org/jenkinsci/plugins/envinject/EnvInjectComputerListener.java
index 22ee643b..9cd94244 100644
--- a/src/main/java/org/jenkinsci/plugins/envinject/EnvInjectComputerListener.java
+++ b/src/main/java/org/jenkinsci/plugins/envinject/EnvInjectComputerListener.java
@@ -20,6 +20,8 @@
import java.io.IOException;
import java.io.Serializable;
+import java.util.Collection;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@@ -53,10 +55,13 @@ public Map call() throws IOException {
globalPropertiesEnvVars.putAll(((EnvironmentVariablesNodeProperty) nodeProperty).getEnvVars());
}
- if (nodeProperty instanceof EnvInjectNodeProperty) {
+ final Node node = c.getNode();
+ if (node != null && nodeProperty instanceof EnvInjectNodeProperty) {
EnvInjectNodeProperty envInjectNodeProperty = ((EnvInjectNodeProperty) nodeProperty);
unsetSystemVariables = envInjectNodeProperty.isUnsetSystemVariables();
- globalPropertiesEnvVars.putAll(envInjectEnvVarsService.getEnvVarsFileProperty(c.getNode().getRootPath(), logger, envInjectNodeProperty.getPropertiesFilePath(), null, nodeEnvVars));
+ globalPropertiesEnvVars.putAll(envInjectEnvVarsService.getEnvVarsFileProperty(
+ node.getRootPath(), logger, envInjectNodeProperty.getPropertiesFilePath(),
+ null, nodeEnvVars));
}
}
@@ -80,6 +85,11 @@ private EnvVars getNewSlaveEnvironmentVariables(Computer c, FilePath nodePath, T
EnvInjectLogger logger = new EnvInjectLogger(listener);
EnvInjectEnvVars envInjectEnvVarsService = new EnvInjectEnvVars(logger);
+ final Node node = c.getNode();
+ if (node == null) {
+ throw new EnvInjectException("Node is removed, but the computer has not gone yet");
+ }
+
//Get env vars for the current node
Map nodeEnvVars = nodePath.act(
new Callable