Skip to content

Commit

Permalink
FindBugs: Prevent NullPointerException if EnvInjectPluginAction#getEn…
Browse files Browse the repository at this point in the history
…vInjectVarList gets called for null envMap
  • Loading branch information
oleg-nenashev committed Sep 18, 2016
1 parent ac6a105 commit dae9348
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import hudson.EnvVars;
import hudson.model.AbstractBuild;
import hudson.model.EnvironmentContributingAction;
import java.util.Collections;
import org.jenkinsci.lib.envinject.EnvInjectAction;

import java.util.Map;
Expand Down Expand Up @@ -45,6 +46,9 @@ public Object getTarget() {

@Nonnull
private EnvInjectVarList getEnvInjectVarList() {
if (envMap == null) {
return new EnvInjectVarList(Collections.<String,String>emptyMap());
}
return new EnvInjectVarList(Maps.transformEntries(envMap,
new Maps.EntryTransformer<String, String, String>() {
public String transformEntry(String key, String value) {
Expand Down

0 comments on commit dae9348

Please sign in to comment.