From 2153db30a2de7b1103e173ad929c0febd0fe3981 Mon Sep 17 00:00:00 2001 From: Nastya Rusina Date: Fri, 8 Apr 2022 14:45:09 -0700 Subject: [PATCH] fix: fix the crash in graph/timeline view for corner case Signed-off-by: Nastya Rusina --- src/components/WorkflowGraph/transformerWorkflowToDag.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/WorkflowGraph/transformerWorkflowToDag.tsx b/src/components/WorkflowGraph/transformerWorkflowToDag.tsx index 81cf411b3..358a2d024 100644 --- a/src/components/WorkflowGraph/transformerWorkflowToDag.tsx +++ b/src/components/WorkflowGraph/transformerWorkflowToDag.tsx @@ -288,6 +288,10 @@ export const transformerWorkflowToDag = ( * @param context The current workflow being parsed */ const parseWorkflow = (root, context: CompiledWorkflow) => { + if (!context?.template?.nodes) { + return root; + } + /* Build Nodes from template */ for (let i = 0; i < context.template.nodes.length; i++) { const compiledNode: CompiledNode = context.template.nodes[i];