Skip to content
Permalink
Browse files
Merge pull request #8 from jenkinsci/jenkins-40113
[FIXED JENKINS-40113] sematic-versioning-plugin causes dashboard to biff
  • Loading branch information
ciroque committed Jan 16, 2017
2 parents 97b5282 + 07d2b75 commit 1cd9ac0b7db35454de79a7e6c9c3bb82ed132727
@@ -32,6 +32,7 @@
import hudson.views.ListViewColumn;
import jenkins.model.Jenkins;
import net.sf.json.JSONObject;
import org.apache.commons.lang.StringUtils;
import org.jenkinsci.plugins.SemanticVersioning.columnDisplay.AbstractColumnDisplayStrategy;
import org.jenkinsci.plugins.SemanticVersioning.columnDisplay.ColumnDisplayStrategy;
import org.jenkinsci.plugins.SemanticVersioning.columnDisplay.LastSuccessfulBuildStrategy;
@@ -83,8 +84,9 @@ public SemanticVersionColumnDescriptor() {

@Override
public ListViewColumn newInstance(StaplerRequest req, JSONObject formData) throws FormException {
String strategy = formData == null ? LastSuccessfulBuildStrategy.class.getCanonicalName() : formData.getString("displayStrategy");
return new SemanticVersionColumn(strategy);
String strategy = formData == null ? null : formData.optString("displayStrategy");
return new SemanticVersionColumn(StringUtils.defaultIfBlank(strategy,
LastSuccessfulBuildStrategy.class.getCanonicalName()));
}

public ListBoxModel doFillDisplayStrategyItems() {

0 comments on commit 1cd9ac0

Please sign in to comment.