mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 14:50:13 -05:00
Fix potential nil access
I can't reproduce a problem here, but based on some user feedback, this could potentially be an issue. Most other modules are calling the super's Update() first thing, but these modules call them later, so healthPercentage may not be defined at this point.
This commit is contained in:
@ -144,7 +144,7 @@ function IceCustomHealth.prototype:Update(unit)
|
|||||||
|
|
||||||
if (self.moduleSettings.scaleHealthColor) then
|
if (self.moduleSettings.scaleHealthColor) then
|
||||||
self.color = "ScaledHealthColor"
|
self.color = "ScaledHealthColor"
|
||||||
elseif self.moduleSettings.lowThresholdColor and self.healthPercentage <= self.moduleSettings.lowThreshold then
|
elseif self.moduleSettings.lowThresholdColor and self.healthPercentage and self.healthPercentage <= self.moduleSettings.lowThreshold then
|
||||||
self.color = "ScaledHealthColor"
|
self.color = "ScaledHealthColor"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ function TargetTargetHealth.prototype:Update(unit)
|
|||||||
|
|
||||||
if (self.moduleSettings.scaleHealthColor) then
|
if (self.moduleSettings.scaleHealthColor) then
|
||||||
self.color = "ScaledHealthColor"
|
self.color = "ScaledHealthColor"
|
||||||
elseif self.moduleSettings.lowThresholdColor and self.healthPercentage <= self.moduleSettings.lowThreshold then
|
elseif self.moduleSettings.lowThresholdColor and self.healthPercentage and self.healthPercentage <= self.moduleSettings.lowThreshold then
|
||||||
self.color = "ScaledHealthColor"
|
self.color = "ScaledHealthColor"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ function TargetTargetMana.prototype:Update(unit)
|
|||||||
|
|
||||||
if (self.moduleSettings.scaleManaColor) then
|
if (self.moduleSettings.scaleManaColor) then
|
||||||
self.color = "ScaledManaColor"
|
self.color = "ScaledManaColor"
|
||||||
elseif self.moduleSettings.lowThresholdColor and self.manaPercentage <= self.moduleSettings.lowThreshold then
|
elseif self.moduleSettings.lowThresholdColor and self.manaPercentage and self.manaPercentage <= self.moduleSettings.lowThreshold then
|
||||||
self.color = "ScaledManaColor"
|
self.color = "ScaledManaColor"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user