From e669629de56acb03969a3208763fc46876906677 Mon Sep 17 00:00:00 2001 From: Tyler Ohlsen Date: Wed, 11 Dec 2024 16:49:32 -0800 Subject: [PATCH] add check to handle empty or missing ui_metadata Signed-off-by: Tyler Ohlsen --- public/pages/workflows/workflow_list/workflow_list.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/public/pages/workflows/workflow_list/workflow_list.tsx b/public/pages/workflows/workflow_list/workflow_list.tsx index 3af17c3a..5c2e6833 100644 --- a/public/pages/workflows/workflow_list/workflow_list.tsx +++ b/public/pages/workflows/workflow_list/workflow_list.tsx @@ -5,7 +5,7 @@ import React, { useState, useEffect } from 'react'; import { useSelector } from 'react-redux'; -import { debounce } from 'lodash'; +import { debounce, isEmpty } from 'lodash'; import { EuiInMemoryTable, Direction, @@ -148,7 +148,9 @@ export function WorkflowList(props: WorkflowListProps) { - {selectedWorkflow?.ui_metadata?.type === WORKFLOW_TYPE.CUSTOM ? ( + {selectedWorkflow?.ui_metadata === undefined || + isEmpty(selectedWorkflow?.ui_metadata) || + selectedWorkflow?.ui_metadata?.type === WORKFLOW_TYPE.CUSTOM ? ( Invalid workflow type} titleSize="s"