Skip to content
Permalink
Browse files
[FIXED JENKINS-40113] sematic-versioning-plugin causes dashboard to biff
  • Loading branch information
stephenc committed Jan 9, 2017
1 parent 97b5282 commit 07d2b75880bc88d5b0824cd9192f2b0139bbb604
@@ -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 07d2b75

Please sign in to comment.