From 4259e9931f6b9eedeeacdbce1fd11e7a38c48406 Mon Sep 17 00:00:00 2001 From: lyt <1105290566@qq.com> Date: Tue, 7 Jun 2022 22:30:57 +0800 Subject: [PATCH] =?UTF-8?q?'admin-22.06.07:=E5=87=BD=E6=95=B0deepClone?= =?UTF-8?q?=E5=AF=B9null=E7=9A=84=E5=88=A4=E6=96=AD=E9=94=99=E8=AF=AF'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/other.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/other.ts b/src/utils/other.ts index 8a3d66c..6bb4fbd 100644 --- a/src/utils/other.ts +++ b/src/utils/other.ts @@ -113,7 +113,7 @@ export function deepClone(obj: any) { newObj = {}; } for (let attr in obj) { - if (typeof obj[attr] === 'object') { + if (obj[attr] && typeof obj[attr] === 'object') { newObj[attr] = deepClone(obj[attr]); } else { newObj[attr] = obj[attr];