🐞 fix(名将擂台): 修复初次挑战对手失败时报错的问题

TypeError: Cannot destructure property 'battleGoods' of '(intermediate value)' as it is null
This commit is contained in:
luying
2022-10-24 11:04:18 +08:00
parent 91477a58a5
commit 687d096cdd
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -344,7 +344,7 @@ async function refreshOpp(ladderMatch: LadderMatchType, needRefresh: boolean) {
export async function ladderBattleEndReward(roleId: string, roleName: string, sid: string, rank: number, isSuccess: boolean, historyRank: number, num: number) {
let dicLadderDifficultRatio = gameData.ladderDifficultRatio.get(rank);
if(!dicLadderDifficultRatio) return null;
if(!dicLadderDifficultRatio) return { battleGoods: [], breakGoods: [] };
let warReward = new WarReward(roleId, roleName, sid, dicLadderDifficultRatio.gkId, isSuccess);
warReward.setLadderReward(dicLadderDifficultRatio.randomWinReward, true);
warReward.setLadderReward(dicLadderDifficultRatio.randomFailReward, false);