Skip to content

Commit

Permalink
fix: ensure metadata is not undefined when accessing label. Fixes #10227
Browse files Browse the repository at this point in the history
 (#10228)

Signed-off-by: Isitha Subasinghe <isitha@pipekit.io>
Co-authored-by: Saravanan Balasubramanian <33908564+sarabala1979@users.noreply.github.com>
  • Loading branch information
isubasinghe and sarabala1979 authored Dec 15, 2022
1 parent 896830d commit 4ed9454
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ export const WorkflowDetails = ({history, location, match}: RouteComponentProps<
'workflows.argoproj.io/workflow-event-binding',
'workflows.argoproj.io/resubmitted-from-workflow'
]) {
const v = workflow?.metadata.labels[k];
const labels = workflow?.metadata?.labels || {};
const v = labels[k];
if (v) {
items.push({
title: 'Previous Runs',
Expand Down

0 comments on commit 4ed9454

Please sign in to comment.