From 3894dc084c7debe7c13b641477fc12f54d123cea Mon Sep 17 00:00:00 2001 From: Matt Meigs Date: Thu, 7 Dec 2023 10:21:14 -0500 Subject: [PATCH] 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,