diff --git a/ui/src/app/workflows/components/workflows-list/workflows-list.tsx b/ui/src/app/workflows/components/workflows-list/workflows-list.tsx index 3b72fab4791c..9c5a9589e5ec 100644 --- a/ui/src/app/workflows/components/workflows-list/workflows-list.tsx +++ b/ui/src/app/workflows/components/workflows-list/workflows-list.tsx @@ -76,7 +76,7 @@ export class WorkflowsList extends BasePage, State> { }); } if (this.state.selectedLabels) { - this.state.selectedLabels.forEach(label => { + this.state?.selectedLabels.forEach(label => { params.append('label', label); }); } @@ -314,7 +314,7 @@ export class WorkflowsList extends BasePage, State> { private countsByCompleted() { const counts = {complete: 0, incomplete: 0}; (this.state.workflows || []).forEach(wf => { - if (wf.metadata.labels && wf.metadata.labels[labels.completed] === 'true') { + if (wf.metadata?.labels && wf.metadata?.labels[labels.completed] === 'true') { counts.complete++; } else { counts.incomplete++; @@ -397,7 +397,7 @@ export class WorkflowsList extends BasePage, State> { checked={this.state.selectedWorkflows.has(wf.metadata.uid)} columns={this.state.columns} onChange={key => { - const value = `${key}=${wf.metadata.labels[key]}`; + const value = `${key}=${wf.metadata?.labels[key]}`; let newTags: string[] = []; if (this.state.selectedLabels.indexOf(value) === -1) { newTags = this.state.selectedLabels.concat(value);