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}`