From 0eaba8c4dfa057aaf4194ad44406c45b9995ef20 Mon Sep 17 00:00:00 2001 From: wingcd Date: Wed, 3 Sep 2025 11:40:38 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E5=90=8D=E8=B5=8B=E7=A9=BA=E5=80=BC=E6=8A=A5=E9=94=99=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复节点名赋空值报错问题 --- cocos/scene-graph/node.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/cocos/scene-graph/node.ts b/cocos/scene-graph/node.ts index fa2286ad6ef..b059a634273 100644 --- a/cocos/scene-graph/node.ts +++ b/cocos/scene-graph/node.ts @@ -150,6 +150,7 @@ export class Node extends CCObject implements ISchedulable, CustomSerializable { return this._name; } set name (value) { + value = value ?? ''; if (DEV && value.indexOf('/') !== -1) { errorID(1632); return; From bae0663dfcb0f7b675a7756147109da0c28cff96 Mon Sep 17 00:00:00 2001 From: wingcd Date: Wed, 3 Sep 2025 12:09:31 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BC=98=E5=8C=96DEV=E4=B8=8B=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E5=90=8D=E4=B8=BA=E7=A9=BA=E6=8A=A5=E9=94=99=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 优化DEV下节点名为空报错问题 --- cocos/scene-graph/node.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cocos/scene-graph/node.ts b/cocos/scene-graph/node.ts index b059a634273..e55d6c329e8 100644 --- a/cocos/scene-graph/node.ts +++ b/cocos/scene-graph/node.ts @@ -150,8 +150,7 @@ export class Node extends CCObject implements ISchedulable, CustomSerializable { return this._name; } set name (value) { - value = value ?? ''; - if (DEV && value.indexOf('/') !== -1) { + if (DEV && value && value.indexOf('/') !== -1) { errorID(1632); return; }