Skip to content

Commit

Permalink
optional chaining to shortcircuit error
Browse files Browse the repository at this point in the history
  • Loading branch information
mmeigs committed Dec 7, 2023
1 parent 040d812 commit 3894dc0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/services/containerServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 3894dc0

Please sign in to comment.