- added protection against potential nil access reported by a user. i can't reproduce it, though

This commit is contained in:
Parnic
2010-11-17 03:57:38 +00:00
parent 4484f1af49
commit 2acb931960

View File

@ -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