From b5aa9d24ac9e0ac124b12bf1eb0ea140b60ab091 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=B1=E9=87=8E=E7=BE=A1=E6=B0=91?= Date: Wed, 18 Dec 2024 03:02:00 +0000 Subject: [PATCH] =?UTF-8?q?=E9=98=B2=E5=BE=A1=E6=80=A7=E7=BC=96=E7=A8=8B?= =?UTF-8?q?=EF=BC=8C=E8=A7=84=E9=81=BF=E6=9C=8D=E5=8A=A1=E7=AB=AFchildren?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E7=9A=84=E4=B8=8D=E6=98=AF=E6=95=B0=E7=BB=84?= =?UTF-8?q?=E6=97=B6=E2=80=A6=E2=80=A6=20update=20src/utils/tree.ts.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 山野羡民 --- src/utils/tree.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/utils/tree.ts b/src/utils/tree.ts index 91059ef9..e5db503f 100644 --- a/src/utils/tree.ts +++ b/src/utils/tree.ts @@ -376,6 +376,9 @@ export const treeToString = (tree: any[], nodeId) => { let str = '' function performAThoroughValidation(arr) { + if (typeof arr === 'undefined' || !Array.isArray(arr) || arr.length === 0) { + return false + } for (const item of arr) { if (item.id === nodeId) { str += ` / ${item.name}`