From 12bd03330affd1613ee783d84c3820b3d41ea7af Mon Sep 17 00:00:00 2001 From: yoimiya-kokomi <592981798@qq.com> Date: Sun, 26 Jun 2022 08:55:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BACharacter=E8=8E=B7=E5=8F=96=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=AE=B9=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/models/Character.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/models/Character.js b/components/models/Character.js index 4a910283..e55fd906 100644 --- a/components/models/Character.js +++ b/components/models/Character.js @@ -117,6 +117,9 @@ let getMeta = function (name) { Character.get = function (val) { let roleid, name; + if (!val) { + return false; + } if (typeof (val) === "number" || /^\d*$/.test(val)) { roleid = val; } else if (val.id) { @@ -131,8 +134,6 @@ Character.get = function (val) { if (!name) { return false; } - - return new Character(name, roleid); };