Skip to content
Permalink
Browse files

[FIXED JENKINS-42367] Missing null check.

  • Loading branch information...
jglick committed Mar 1, 2017
1 parent 7e0b274 commit 2ee7ab7dd9da1b428009c663935a134625890263
@@ -82,7 +82,7 @@

private static void addValue(Map<String, Object> values, ParameterValue parameterValue) {
Object value = parameterValue.getValue();
if (!(value instanceof Serializable)) {
if (value != null && !(value instanceof Serializable)) {
boolean canPickle = false;
for (PickleFactory pf : PickleFactory.all()) {
if (pf.writeReplace(value) != null) {
@@ -60,4 +60,12 @@
r.assertLogContains("PASS=s3cr3t", b);
}

@Issue("JENKINS-42367")
@Test public void nullValue() throws Exception {
WorkflowJob p = r.jenkins.createProject(WorkflowJob.class, "p");
p.setDefinition(new CpsFlowDefinition("echo(/TEXT=${params.TEXT}/)",true));
p.addProperty(new ParametersDefinitionProperty(new StringParameterDefinition("TEXT", "")));
r.assertLogContains("TEXT=null", r.assertBuildStatusSuccess(p.scheduleBuild2(0, new ParametersAction(new StringParameterValue("TEXT", /* not possible via UI, but to simulate other ParameterValue impls */null)))));
}

}

0 comments on commit 2ee7ab7

Please sign in to comment.
You can’t perform that action at this time.