mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-11-25 01:21:55 +00:00
为Character获取增加容错
This commit is contained in:
parent
f70415f4fe
commit
12bd03330a
@ -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);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user