Skip to content

fix: crash when deployment not found in logs viewer#214

Open
Chandraveersingh1717 wants to merge 1 commit intometacall:masterfrom
Chandraveersingh1717:fix/logs-deployment-not-found
Open

fix: crash when deployment not found in logs viewer#214
Chandraveersingh1717 wants to merge 1 commit intometacall:masterfrom
Chandraveersingh1717:fix/logs-deployment-not-found

Conversation

@Chandraveersingh1717
Copy link

Fix: Crash when deployment not found in logs viewer

Problem:
Logs viewer crashes with "Cannot read property 'status' of undefined" when deployment doesn't exist.

Root cause:
app = (await api.inspect()).filter(dep => dep.suffix === suffix)[0];
// If filter returns [], app is undefined → crashes on app.status

Solution:

  • Check if deployment exists before accessing properties
  • Show clear error: "Deployment with suffix "{suffix}" not found"
  • Split filter and array access for safety

Changes:
const deployments = (await api.inspect()).filter(dep => dep.suffix === suffix);
if (deployments.length === 0) {
error(Deployment with suffix "${suffix}" not found);
}
app = deployments[0];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant