From c2678e670e3c64bb80c6267805a56a6a39fba1db Mon Sep 17 00:00:00 2001 From: mmeigs Date: Thu, 7 Dec 2023 12:49:59 -0500 Subject: [PATCH] Bugfix: Optional chaining to shortcircuit error with container (#949) optional chaining to shortcircuit error --- src/services/containerServices.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/containerServices.ts b/src/services/containerServices.ts index e6bda7a24..9e063acca 100644 --- a/src/services/containerServices.ts +++ b/src/services/containerServices.ts @@ -97,7 +97,7 @@ export class ECSContainer implements IContainerServices { }); // Only stop ECS task if it's still running - if (res.tasks?.[0].lastStatus === 'RUNNING') { + if (res.tasks?.[0]?.lastStatus === 'RUNNING') { await this._client.stopTask({ cluster: clusterName, task: taskId,