mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 14:50:13 -05:00
- added protection against potential nil access reported by a user. i can't reproduce it, though
This commit is contained in:
@ -873,6 +873,10 @@ end
|
|||||||
|
|
||||||
|
|
||||||
function IceTargetHealth.prototype:SetTexLoc(texframe, xpos, ypos, anchorFrom, anchorTo)
|
function IceTargetHealth.prototype:SetTexLoc(texframe, xpos, ypos, anchorFrom, anchorTo)
|
||||||
|
if not texframe then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
texframe:Show()
|
texframe:Show()
|
||||||
texframe:ClearAllPoints()
|
texframe:ClearAllPoints()
|
||||||
texframe:SetPoint(anchorFrom or "TOPLEFT", self.frame, anchorTo or "TOPLEFT", xpos or 0, ypos or 0)
|
texframe:SetPoint(anchorFrom or "TOPLEFT", self.frame, anchorTo or "TOPLEFT", xpos or 0, ypos or 0)
|
||||||
@ -880,6 +884,10 @@ end
|
|||||||
|
|
||||||
|
|
||||||
function IceTargetHealth.prototype:SetTexScale(texframe, width, height, scale)
|
function IceTargetHealth.prototype:SetTexScale(texframe, width, height, scale)
|
||||||
|
if not texframe then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
texframe:SetWidth(width * scale)
|
texframe:SetWidth(width * scale)
|
||||||
texframe:SetHeight(height * scale)
|
texframe:SetHeight(height * scale)
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user