diff --git a/lua/app/bf/unity/uiprefab_object.lua b/lua/app/bf/unity/uiprefab_object.lua index 996e5530..ffa3e57d 100644 --- a/lua/app/bf/unity/uiprefab_object.lua +++ b/lua/app/bf/unity/uiprefab_object.lua @@ -763,6 +763,9 @@ function UIPrefabObject:addRedPoint(offsetX, offsetY, scale, iconName, count, na if not self.redPoint then if not self.loadRpOver then self.loadRpOver = true + if self:isDestroyed() or CS.BF.Utils.IsNull(self:getGameObject()) then + return + end UIPrefabManager:loadUIWidgetAsync("assets/prefabs/ui/common/red_point_cell.prefab", self, function(prefabObject) self.redPoint = prefabObject prefabObject:initPrefabHelper() diff --git a/lua/app/ui/common/cell/hero_cell.lua b/lua/app/ui/common/cell/hero_cell.lua index 732496b6..3812df2e 100644 --- a/lua/app/ui/common/cell/hero_cell.lua +++ b/lua/app/ui/common/cell/hero_cell.lua @@ -95,6 +95,10 @@ function HeroCell:refreshRedPoint() return end + if not self.selfNode or self.selfNode:isDestroyed() or CS.BF.Utils.IsNull(self.selfNode:getGameObject()) then + return + end + if DataManager.FormationData:heroInFormation(GConst.BattleConst.FORMATION_TYPE.STAGE, self.heroEntity:getCfgId()) and DataManager.EquipData:canUpgradeEquip(self.heroEntity:getCfgId()) then self.selfNode:addRedPoint(55, -35, 0.64) else