其他地方也添加判空处理

This commit is contained in:
luying
2022-05-27 19:20:01 +08:00
parent a25dcc5e00
commit f9ec0d782b
2 changed files with 12 additions and 2 deletions

View File

@@ -456,7 +456,14 @@ export function getPvpHeroRewardsByScore(score: number) {
return item;
}
}
return null
return getMaxPvpHeroRewards()
}
function getMaxPvpHeroRewards() {
if(gameData.pvpHeroRewards.length <= 0) return null
return gameData.pvpHeroRewards.reduce((pre, cur) => {
return cur.max > pre.max? cur: pre;
}, gameData.pvpHeroRewards[0])
}
export function getPvpRankRewardsByRank(rankLv: number) {