From 33287aad57ba37bdd52464ac218b2980a711558f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Czouyf=E2=80=9D?= <80906036@qq.com> Date: Fri, 15 Nov 2024 16:59:52 +0800 Subject: [PATCH] 1 --- src/renderer/src/utils/comm.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/utils/comm.js b/src/renderer/src/utils/comm.js index a0d457f..81dd001 100644 --- a/src/renderer/src/utils/comm.js +++ b/src/renderer/src/utils/comm.js @@ -127,7 +127,10 @@ export const removePropertyOf = function(obj){ export function removeTree(list) { var this_ = this for (var i in list) { - if (list[i].children.length == 0) { + if (list[i].children == null) { + delete list[i].children; + } + else if (list[i].children.length == 0) { list[i].children = undefined } else { this_.removeTree(list[i].children)