From eb73f95d686b48a0055e3bc095d48e5364748d5c Mon Sep 17 00:00:00 2001 From: Sanjula Ganepola Date: Thu, 5 Dec 2024 22:22:12 -0500 Subject: [PATCH] Fix preStepIndex Signed-off-by: Sanjula Ganepola --- src/act.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/act.ts b/src/act.ts index 1074411..e7e589f 100644 --- a/src/act.ts +++ b/src/act.ts @@ -505,7 +505,7 @@ export class Act { const preStepName = `Pre ${parsedMessage.step}`; let preStepIndex = this.historyManager.workspaceHistory[commandArgs.path][historyIndex].jobs![jobIndex].steps! .findIndex(step => step.id === stepId && step.name === preStepName); - if (this.historyManager.workspaceHistory[commandArgs.path][historyIndex].jobs![jobIndex].steps![preStepIndex].status === HistoryStatus.Running) { + if (preStepIndex > -1 && this.historyManager.workspaceHistory[commandArgs.path][historyIndex].jobs![jobIndex].steps![preStepIndex].status === HistoryStatus.Running) { this.historyManager.workspaceHistory[commandArgs.path][historyIndex].jobs![jobIndex].steps![preStepIndex].status = HistoryStatus.Success; this.historyManager.workspaceHistory[commandArgs.path][historyIndex].jobs![jobIndex].steps![preStepIndex].date.end = dateString;