其他地方也添加判空处理
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user