diff --git a/lua/app/module/battle/controller/battle_base_controller.lua b/lua/app/module/battle/controller/battle_base_controller.lua index 5c0bccb8..256c6ed4 100644 --- a/lua/app/module/battle/controller/battle_base_controller.lua +++ b/lua/app/module/battle/controller/battle_base_controller.lua @@ -343,8 +343,10 @@ function BattleBaseController:onLinkChange() end local elementTypeCount = 0 - for element, count in pairs(dmgElementTypeMap) do - elementTypeCount = elementTypeCount + count + if dmgElementTypeMap then + for element, count in pairs(dmgElementTypeMap) do + elementTypeCount = elementTypeCount + count + end end local dmg = self:calExpectedInjury(mainElementType, elementTypeCount, dmgSkillId) local defMainUnitcomp = self:getCurOtherActionUnitComp()