Skip to content
Permalink
Browse files

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

…ameters.
  • Loading branch information...
jglick committed Mar 5, 2018
1 parent 6117535 commit ff34532460d2ef50eee9f82cae9d983ea5095c58
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 ff34532

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