Skip to content
Permalink
Browse files

[JENKINS-39495] Defend against a null serialized ParametersAction.par…

…ameters.

(cherry picked from commit ff34532)
  • Loading branch information...
jglick authored and olivergondza committed Mar 5, 2018
1 parent 1400918 commit 115612bbf5582f2351e4d1a0dfbb3ffbbcdbba9a
Showing with 5 additions and 2 deletions.
  1. +5 −2 core/src/main/java/hudson/model/ParametersAction.java
@@ -87,7 +87,7 @@

private Set<String> safeParameters;

private final List<ParameterValue> parameters;
private @Nonnull List<ParameterValue> parameters;

private List<String> parameterDefinitionNames;

@@ -99,7 +99,7 @@

private transient Run<?, ?> run;

public ParametersAction(List<ParameterValue> parameters) {
public ParametersAction(@Nonnull List<ParameterValue> parameters) {
this.parameters = new ArrayList<>(parameters);
String paramNames = SystemProperties.getString(SAFE_PARAMETERS_SYSTEM_PROPERTY_NAME);
safeParameters = new TreeSet<>();
@@ -284,6 +284,9 @@ public ParametersAction merge(@CheckForNull ParametersAction overrides) {
}

private Object readResolve() {
if (parameters == null) { // JENKINS-39495
parameters = Collections.emptyList();
}
if (build != null)
OldDataMonitor.report(build, "1.283");
if (safeParameters == null) {

0 comments on commit 115612b

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