Skip to content
Permalink
Browse files
[FIXED JENKINS-39168] NPE from last update.
  • Loading branch information
jglick committed Oct 21, 2016
1 parent 64083be commit be5984a600d1a25d252ca5bfcf757e5af7f5e0bb
Showing with 13 additions and 0 deletions.
  1. +13 −0 src/main/java/org/jenkinsci/plugins/workflow/support/steps/input/InputAction.java
@@ -6,6 +6,7 @@

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.TimeUnit;
@@ -121,13 +122,19 @@ public String getUrlName() {

public synchronized void add(@Nonnull InputStepExecution step) throws IOException, InterruptedException, TimeoutException {
loadExecutions();
if (executions == null) {
throw new IOException("cannot load state");
}
this.executions.add(step);
ids.add(step.getId());
run.save();
}

public synchronized InputStepExecution getExecution(String id) throws InterruptedException, TimeoutException {
loadExecutions();
if (executions == null) {
return null;
}
for (InputStepExecution e : executions) {
if (e.input.getId().equals(id))
return e;
@@ -137,6 +144,9 @@ public synchronized InputStepExecution getExecution(String id) throws Interrupte

public synchronized List<InputStepExecution> getExecutions() throws InterruptedException, TimeoutException {
loadExecutions();
if (executions == null) {
return Collections.emptyList();
}
return new ArrayList<InputStepExecution>(executions);
}

@@ -145,6 +155,9 @@ public synchronized List<InputStepExecution> getExecutions() throws InterruptedE
*/
public synchronized void remove(InputStepExecution exec) throws IOException, InterruptedException, TimeoutException {
loadExecutions();
if (executions == null) {
throw new IOException("cannot load state");
}
executions.remove(exec);
ids.remove(exec.getId());
run.save();

0 comments on commit be5984a

Please sign in to comment.