Skip to content

Commit

Permalink
[JENKINS-73726] Avoid NPE trying to cancel a block which is already done
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick committed Sep 5, 2024
1 parent 3761c26 commit 27eb8b8
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,9 @@ public boolean cancel(Throwable error) {
t.getExecution().runInCpsVmThread(new FutureCallback<>() {
@Override
public void onSuccess(CpsThreadGroup g) {
if (thread == null) {
return;
}
// Similar to getCurrentExecutions but we want the raw CpsThread, not a StepExecution; cf. CpsFlowExecution.interrupt
Map<FlowHead, CpsThread> m = new LinkedHashMap<>();
for (CpsThread t : thread.group.getThreads()) {
Expand Down

0 comments on commit 27eb8b8

Please sign in to comment.