添加一些容错

This commit is contained in:
xiekaidong 2023-07-24 17:04:40 +08:00
parent fddf41fca5
commit 6bc0ce7738
8 changed files with 24 additions and 7 deletions

View File

@ -79,7 +79,7 @@ end
function BattleManager:rspSkillRefresh(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
if self.battleController then
if self.battleController and result.reqData then
self.battleController.battleData:addRefreshSkillCount(result.reqData.ad)
end
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.SKILL_REFRESH_SUCC)

View File

@ -51,6 +51,10 @@ end
function ChapterManager:startFightFinish(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
if not result.reqData then
return
end
local params = {}
if result.reqData.isTrail then
params.atkFormation = DataManager.ChapterData:getCacheTrailAtkInfo()
@ -95,6 +99,10 @@ end
function ChapterManager:endFightFinish(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
if not result.reqData then
return
end
local reqData = result.reqData
local maxChapter = DataManager.ChapterData:getNewChapterId()
local rewards = {}

View File

@ -61,7 +61,7 @@ function CommerceManager:onBuyArenaTicketFinish(data)
return
end
if data.reqData.ad then
if data.reqData and data.reqData.ad then
-- 激励视频
DataManager.PlayerData:addArenaTicketAdBuyCount()
else

View File

@ -91,6 +91,9 @@ end
function DailyChallengeManager:endChallengeFinish(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
if not result.reqData then
return
end
local reqData = result.reqData
local rewards = result.rewards
ModuleManager.BattleManager:showBattleResultUI(GConst.BattleConst.BATTLE_TYPE.DAILY_CHALLENGE, rewards, reqData.combatReport)

View File

@ -183,7 +183,7 @@ end
function DungeonManager:respEndChallengeShards(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.DungeonData:initDungeonShards(result.shards_challenge)
ModuleManager.BattleManager:showBattleResultUI(GConst.BattleConst.BATTLE_TYPE.DUNGEON_SHARDS, result.rewards, result.reqData.combatReport)
ModuleManager.BattleManager:showBattleResultUI(GConst.BattleConst.BATTLE_TYPE.DUNGEON_SHARDS, result.rewards, result.reqData and result.reqData.combatReport or {})
end
end

View File

@ -21,7 +21,9 @@ function FormationManager:upHeroToStageFormationFinish(result)
data.formation, data.formation_lv, data.formation_atk, data.formation_hp = DataManager.FormationData:getStageFormationBIStr()
data.formation_lv = nil
CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSet(data)
BIReport:postHeroOpt(result.reqData.id, BIReport.HERO_OPT_TYPE.FORMATION)
if result.reqData then
BIReport:postHeroOpt(result.reqData.id, BIReport.HERO_OPT_TYPE.FORMATION)
end
end
end
@ -37,7 +39,9 @@ end
function FormationManager:rspArenaFormation(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.FormationData:initArena(result.reqData.attack_heroIds, result.reqData.defend_heroIds)
if result.reqData then
DataManager.FormationData:initArena(result.reqData.attack_heroIds, result.reqData.defend_heroIds)
end
end
end

View File

@ -28,7 +28,7 @@ end
function TutorialManager:sendTutorialIdFinish(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
if result.reqData.id then
if result.reqData and result.reqData.id then
BIReport:postTutorialStep(result.reqData.id)
end

View File

@ -332,7 +332,9 @@ function BattleResultUI:refreshArenaGradingSpine(gradingId, isUp)
self.arenaSpine:setLocalScale(0.8, 0.8, 1)
self.arenaSpine:setSkin(DataManager.ArenaData:getGradingNumName(gradingId))
self.arenaSpine:playAnimComplete("born", false, false, function()
self.arenaSpine:playAnim("idle", true, false)
if self.arenaSpine then
self.arenaSpine:playAnim("idle", true, false)
end
end)
end)
if isUp then