Skip to content

Commit

Permalink
JENKINS-27665: Avoid NPE when sensibleVariables isn't set
Browse files Browse the repository at this point in the history
usecase: EnvInjectAction.writeReplace() is called after a promotion (promoted build plugin) launched from a build recorded before jenkins was restarted. EnvInjectAction.overrideAll() isn't called thus sensibleVariables is null.
  • Loading branch information
aheritier committed Jul 9, 2015
1 parent 0033cdf commit b2ffaa0
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -91,7 +91,7 @@ private Object writeReplace() throws ObjectStreamException {
dao.saveEnvironment(build.getRootDir(), Maps.transformEntries(envMap,
new Maps.EntryTransformer<String, String, String>() {
public String transformEntry(String key, String value) {
return sensibleVariables.contains(key) ? "********" : value;
return sensibleVariables != null && sensibleVariables.contains(key) ? "********" : value;
}
}));
return this;
Expand Down

0 comments on commit b2ffaa0

Please sign in to comment.