From 98c3c2cad8df5c7e18b128e2ddec3754e69003af Mon Sep 17 00:00:00 2001 From: Parnic Date: Fri, 25 Jan 2008 06:12:04 +0000 Subject: [PATCH] - fix a rare case of accessing nil variables when bars are switching quickly --- IceBarElement.lua | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/IceBarElement.lua b/IceBarElement.lua index 0edbc61..89d132f 100644 --- a/IceBarElement.lua +++ b/IceBarElement.lua @@ -438,10 +438,17 @@ function IceBarElement.prototype:CreateTexts() self.frame.bottomUpperText:ClearAllPoints() self.frame.bottomLowerText:ClearAllPoints() - offx = offx + self.moduleSettings.textHorizontalOffset + if self.moduleSettings.textHorizontalOffset ~= nil then + offx = offx + self.moduleSettings.textHorizontalOffset + end - self.frame.bottomUpperText:SetPoint("TOP"..ownPoint , self.frame, "BOTTOM"..parentPoint, offx, self.moduleSettings.textVerticalOffset) - self.frame.bottomLowerText:SetPoint("TOP"..ownPoint , self.frame, "BOTTOM"..parentPoint, offx, self.moduleSettings.textVerticalOffset - 14) + local offy = 0 + if self.moduleSettings.textVerticalOffset ~= nil then + offy = self.moduleSettings.textVerticalOffset + end + + self.frame.bottomUpperText:SetPoint("TOP"..ownPoint , self.frame, "BOTTOM"..parentPoint, offx, offy) + self.frame.bottomLowerText:SetPoint("TOP"..ownPoint , self.frame, "BOTTOM"..parentPoint, offx, offy - 14) if (self.moduleSettings.textVisible["upper"]) then self.frame.bottomUpperText:Show()