From fbad3337cf66e49c26ab34857944ea3de4f4a1e1 Mon Sep 17 00:00:00 2001 From: ZLY Date: Tue, 2 Sep 2025 09:55:54 +0800 Subject: [PATCH] =?UTF-8?q?pref(flowEditor):=20=E4=BC=98=E5=8C=96=20WaitEd?= =?UTF-8?q?itor=20=E7=BB=84=E4=BB=B6=E4=B8=AD=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在检查 nodeData.component.customDef 时添加空值保护,提高代码健壮性 --- src/pages/flowEditor/nodeEditors/components/WaitEditor.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/flowEditor/nodeEditors/components/WaitEditor.tsx b/src/pages/flowEditor/nodeEditors/components/WaitEditor.tsx index 2634afa..91ba70d 100644 --- a/src/pages/flowEditor/nodeEditors/components/WaitEditor.tsx +++ b/src/pages/flowEditor/nodeEditors/components/WaitEditor.tsx @@ -25,7 +25,7 @@ const WaitEditor: React.FC = ({ nodeData, updateNodeData }) => }); useEffect(() => { - if (nodeData.component.customDef) { + if (nodeData?.component?.customDef) { const duration = JSON.parse(nodeData.component.customDef).duration; setDuration({ hour: Math.floor(duration / 3600),