Skip to content
Permalink
Browse files

Merge pull request #3327 from jglick/ParametersAction-NPE-JENKINS-39495

[JENKINS-39495] Defend against a null serialized ParametersAction.parameters
  • Loading branch information...
oleg-nenashev committed Mar 10, 2018
2 parents 86e510a + ff34532 commit 20bc2e899473e3338f9f23cd96c53f423ba3e69e
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 20bc2e8

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