Skip to content
Permalink
Browse files
JENKINS-40786 - check constructor for null values
Fixes wonky initialization behavior with pipeline scripts

Addresses https://issues.jenkins-ci.org/browse/JENKINS-40786
  • Loading branch information
dobbymoodge committed Jan 11, 2017
1 parent 30e3d7b commit 5ceaf176a0cbb1e719b8aa96e18ddbed899bbc77
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/main/java/hudson/plugins/s3/S3BucketPublisher.java
@@ -69,10 +69,16 @@ public S3BucketPublisher(String profileName, List<Entry> entries, List<MetadataP

this.dontWaitForConcurrentBuildCompletion = dontWaitForConcurrentBuildCompletion;
this.consoleLogLevel = parseLevel(consoleLogLevel);
this.pluginFailureResultConstraint = Result.fromString(pluginFailureResultConstraint);
if (pluginFailureResultConstraint == null) {
this.pluginFailureResultConstraint = Result.FAILURE;
} else {
this.pluginFailureResultConstraint = Result.fromString(pluginFailureResultConstraint);
}
}

private Level parseLevel(String lvl) {
if (lvl == null)
lvl = "";
switch (lvl) {
case "WARNING": return Level.WARNING;
case "SEVERE": return Level.SEVERE;

0 comments on commit 5ceaf17

Please sign in to comment.