Skip to content

Commit

Permalink
fix: UI crashes after submitting workflows (#11018)
Browse files Browse the repository at this point in the history
Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
  • Loading branch information
terrytangyuan committed May 1, 2023
1 parent 547c989 commit 1af85fd
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -76,7 +76,7 @@ export class WorkflowsList extends BasePage<RouteComponentProps<any>, State> {
});
}
if (this.state.selectedLabels) {
this.state.selectedLabels.forEach(label => {
this.state?.selectedLabels.forEach(label => {
params.append('label', label);
});
}
Expand Down Expand Up @@ -314,7 +314,7 @@ export class WorkflowsList extends BasePage<RouteComponentProps<any>, 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++;
Expand Down Expand Up @@ -397,7 +397,7 @@ export class WorkflowsList extends BasePage<RouteComponentProps<any>, 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);
Expand Down

0 comments on commit 1af85fd

Please sign in to comment.