diff --git a/apps/character/profile-stat.js b/apps/character/profile-stat.js index 72c4b094..15638f4f 100644 --- a/apps/character/profile-stat.js +++ b/apps/character/profile-stat.js @@ -44,8 +44,11 @@ export async function profileStat (e) { avatar.aeq = talent?.a?.original + talent?.e?.original + talent?.q?.original || 3 avatarRet.push(avatar) if (profiles[id]) { - let mark = profiles[id].getArtisMark(false) - avatar.artisMark = Data.getData(mark, 'mark,markClass,names') + let profile = profiles[id] + if(profile.hasData) { + let mark = profiles[id].getArtisMark(false) + avatar.artisMark = Data.getData(mark, 'mark,markClass,names') + } } }) diff --git a/models/Character.js b/models/Character.js index e16602d7..8d6be54f 100644 --- a/models/Character.js +++ b/models/Character.js @@ -203,7 +203,7 @@ class Character extends Base { if (CharId.isTraveler(avatar.id)) { let char = Character.get({ id: avatar.id, - elem: (avatar.elem || avatar.element).toLowerCase() || 'anemo' + elem: (avatar.elem || avatar.element || 'anemo').toLowerCase() }) char.setTraveler(uid) return char diff --git a/models/ProfileData.js b/models/ProfileData.js index 4ef5cae2..269f5262 100644 --- a/models/ProfileData.js +++ b/models/ProfileData.js @@ -125,7 +125,10 @@ export default class ProfileData extends Base { // 获取当前profileData的圣遗物评分,withDetail=false仅返回简略信息 getArtisMark (withDetail = true) { - return this.artis.getMarkDetail(withDetail) + if(this.hasData) { + return this.artis.getMarkDetail(withDetail) + } + return {} } // 计算当前profileData的伤害信息