Skip to content

Commit

Permalink
[FIXED JENKINS-9359] defend against NPE in EnvAction
Browse files Browse the repository at this point in the history
  • Loading branch information
alanharder committed Apr 15, 2011
1 parent 40fcf75 commit 8a1e337
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/hudson/plugins/copyartifact/CopyArtifact.java
Expand Up @@ -348,6 +348,7 @@ private static class EnvAction implements EnvironmentContributingAction {
private transient Map<String,String> data = new HashMap<String,String>();

private void add(String projectName, int buildNumber) {
if (data==null) return;
int i = projectName.indexOf('/'); // Omit any detail after a /
if (i > 0) projectName = projectName.substring(0, i);
data.put("COPYARTIFACT_BUILD_NUMBER_"
Expand All @@ -356,7 +357,7 @@ private void add(String projectName, int buildNumber) {
}

public void buildEnvVars(AbstractBuild<?,?> build, EnvVars env) {
env.putAll(data);
if (data!=null) env.putAll(data);
}

public String getIconFileName() { return null; }
Expand Down

0 comments on commit 8a1e337

Please sign in to comment.