File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
src/main/java/org/jenkinsci/plugins/workflow/support/steps Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -1031,10 +1031,13 @@ private static final class Callback extends BodyExecutionCallback.TailCall {
10311031 return ;
10321032 }
10331033 LOGGER .log (FINE , "finished {0}" , execution .getContext ());
1034+ var state = execution .state ;
10341035 try {
1035- WorkspaceList .Lease _lease = ExtensionList .lookupSingleton (ExecutorStepDynamicContext .WorkspaceListLeaseTranslator .class ).get (execution .state );
1036- if (_lease != null ) {
1037- _lease .release ();
1036+ if (state != null ) {
1037+ WorkspaceList .Lease _lease = ExtensionList .lookupSingleton (ExecutorStepDynamicContext .WorkspaceListLeaseTranslator .class ).get (state );
1038+ if (_lease != null ) {
1039+ _lease .release ();
1040+ }
10381041 }
10391042 } finally {
10401043 finish (execution .getContext (), cookie );
@@ -1045,7 +1048,9 @@ private static final class Callback extends BodyExecutionCallback.TailCall {
10451048 boolean _stopping = t .stopping ;
10461049 t .stopping = true ;
10471050 try {
1048- if (Queue .getInstance ().cancel (execution .state .task )) {
1051+ if (state == null ) {
1052+ LOGGER .fine (() -> execution .getContext () + " not yet scheduled" );
1053+ } else if (Queue .getInstance ().cancel (state .task )) {
10491054 LOGGER .fine (() -> "cancelled leftover task from " + execution .getContext ());
10501055 } else {
10511056 LOGGER .fine (() -> "was unable to cancel any leftover task from " + execution .getContext ());
You can’t perform that action at this time.
0 commit comments