From 80f82a8a606127f5b1b328aba8548ce84ec92089 Mon Sep 17 00:00:00 2001 From: Chandraveer Date: Thu, 12 Mar 2026 15:21:30 +0530 Subject: [PATCH] fix: crash when deployment not found in logs viewer --- src/logs.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/logs.ts b/src/logs.ts index 178710e..3d14afb 100644 --- a/src/logs.ts +++ b/src/logs.ts @@ -27,12 +27,19 @@ const showLogs = async ( let logsTill: string[] = ['']; - let app: Deployment; + let app: Deployment | undefined; let status: DeployStatus = 'create'; while (status !== 'ready') { - app = (await api.inspect()).filter(dep => dep.suffix === suffix)[0]; + const deployments = (await api.inspect()).filter( + dep => dep.suffix === suffix + ); + + if (deployments.length === 0) { + error(`Deployment with suffix "${suffix}" not found`); + } + app = deployments[0]; status = app.status; const prefix = app.prefix;