Skip to content

Commit

Permalink
[JENKINS-43361] Unreproducible NPE.
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick committed Apr 13, 2017
1 parent 92019ea commit 425be85
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Expand Up @@ -694,7 +694,7 @@ public void waitForSuspension() throws InterruptedException, ExecutionException
g.scheduleRun().get();
}

public synchronized FlowHead getFlowHead(int id) {
public synchronized @CheckForNull FlowHead getFlowHead(int id) {
return heads.get(id);
}

Expand Down
Expand Up @@ -383,7 +383,12 @@ private void scheduleNextRun() {

final List<FlowNode> parents = new ArrayList<FlowNode>();
for (int head : bodyHeads) {
parents.add(flow.getFlowHead(head).get());
FlowHead flowHead = flow.getFlowHead(head);
if (flowHead != null) {
parents.add(flowHead.get());
} else {
LOGGER.log(Level.WARNING, "Could not find flow head #{0}", head);
}
}

flow.runInCpsVmThread(new FutureCallback<CpsThreadGroup>() {
Expand Down

0 comments on commit 425be85

Please sign in to comment.