fix(app): avoid 'no label' error when deleting external app [EE-6019] (#11697)

Co-authored-by: testa113 <testa113>
pull/11765/head
Ali 2024-05-02 14:22:12 +12:00 committed by GitHub
parent 5191fc9220
commit da134c3e3f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -95,7 +95,7 @@ class KubernetesApplicationsController {
} else { } else {
await this.KubernetesApplicationService.delete(application); await this.KubernetesApplicationService.delete(application);
if (application.Metadata.labels[KubernetesPortainerApplicationStackNameLabel]) { if (application.Metadata.labels && application.Metadata.labels[KubernetesPortainerApplicationStackNameLabel]) {
// Update applications in stack // Update applications in stack
const stack = this.state.stacks.find((x) => x.Name === application.StackName); const stack = this.state.stacks.find((x) => x.Name === application.StackName);
const index = stack.Applications.indexOf(application); const index = stack.Applications.indexOf(application);