Skip to content

Commit

Permalink
[FIXED JENKINS-47421] Make sure we init stagesList in readResolve
Browse files Browse the repository at this point in the history
This is a very minor issue in practice - the ExecutionModelAction
isn't really used by anything but our own check for multiple executed
pipeline blocks, which itself can't ever be the case on builds that
started before Declarative 1.2 in the first place. Buuuuut it does
result in some weird unreadable data messages in Jenkins, so let's
play things very safe.
  • Loading branch information
abayer committed Oct 20, 2017
1 parent 47f97fb commit 342ca4c
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -35,7 +35,7 @@
public class ExecutionModelAction extends InvisibleAction {
private ModelASTStages stages;
private String stagesUUID;
private final List<ModelASTStages> stagesList = new ArrayList<>();
private List<ModelASTStages> stagesList = new ArrayList<>();

public ExecutionModelAction(ModelASTStages s) {
this.stagesList.add(s);
Expand All @@ -49,7 +49,11 @@ public ExecutionModelAction(List<ModelASTStages> s) {

protected Object readResolve() throws IOException {
if (this.stages != null) {
if (this.stagesList == null) {
this.stagesList = new ArrayList<>();
}
this.stagesList.add(stages);

this.stages = null;
}
return this;
Expand Down

0 comments on commit 342ca4c

Please sign in to comment.