diff --git a/cocos/scene-graph/node.ts b/cocos/scene-graph/node.ts index fa2286ad6ef..e55d6c329e8 100644 --- a/cocos/scene-graph/node.ts +++ b/cocos/scene-graph/node.ts @@ -150,7 +150,7 @@ export class Node extends CCObject implements ISchedulable, CustomSerializable { return this._name; } set name (value) { - if (DEV && value.indexOf('/') !== -1) { + if (DEV && value && value.indexOf('/') !== -1) { errorID(1632); return; }