Skip to content
This repository has been archived by the owner on Aug 15, 2023. It is now read-only.

Commit

Permalink
前端处理米游社 API 返回空角色列表的问题,ref #909
Browse files Browse the repository at this point in the history
  • Loading branch information
mark9804 committed Sep 9, 2022
1 parent f73bce8 commit 7d19b8b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/views/component/card/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ export default defineComponent({
const hasLevelInfo = params.level !== -1;
const hasPlayerNameInfo = params.nickname !== "";
const randomAvatarOrder = Math.floor(Math.random() * params.avatars.length);
const target = params.avatars[randomAvatarOrder];
const targetHasCostume = params.avatars[randomAvatarOrder]["costumes"].length !== 0;
const target = params?.avatars.length > 0 ? params.avatars[randomAvatarOrder] : { costumes: [] };
const targetHasCostume = target?.costumes.length !== 0;
const costumeName = targetHasCostume ? params.avatars[randomAvatarOrder]["costumes"][0]["name"] : "";
const qqid = params.qqid || "";
const charactersMap = params.character;
Expand Down

0 comments on commit 7d19b8b

Please sign in to comment.