Skip to content

Commit

Permalink
add check to handle empty or missing ui_metadata
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Ohlsen <[email protected]>
  • Loading branch information
ohltyler committed Dec 12, 2024
1 parent 51f896f commit e669629
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions public/pages/workflows/workflow_list/workflow_list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -148,7 +148,9 @@ export function WorkflowList(props: WorkflowListProps) {
</EuiText>
</EuiFlyoutHeader>
<EuiFlyoutBody>
{selectedWorkflow?.ui_metadata?.type === WORKFLOW_TYPE.CUSTOM ? (
{selectedWorkflow?.ui_metadata === undefined ||
isEmpty(selectedWorkflow?.ui_metadata) ||
selectedWorkflow?.ui_metadata?.type === WORKFLOW_TYPE.CUSTOM ? (
<EuiEmptyPrompt
title={<h2>Invalid workflow type</h2>}
titleSize="s"
Expand Down

0 comments on commit e669629

Please sign in to comment.