Commit 2b692aec authored by Blazeflack's avatar Blazeflack

Fixed potential nil error

parent 18d6945b
...@@ -65,13 +65,13 @@ local function SetCastbarSizeAndPosition(unit, unitframe, overlayFrame) ...@@ -65,13 +65,13 @@ local function SetCastbarSizeAndPosition(unit, unitframe, overlayFrame)
castbar:SetFrameLevel(frameLevel) castbar:SetFrameLevel(frameLevel)
--Adjust size of castbar icon --Adjust size of castbar icon
castbar.Icon.bg:Size(overlayHeight + unitframe.BORDER*2) castbar.ButtonIcon.bg:Size(overlayHeight + unitframe.BORDER*2)
-- Position the castbar on overLayFrame -- Position the castbar on overLayFrame
if (not cdb.iconAttached) then if (not cdb.iconAttached) then
castbar:SetInside(overlayFrame, 0, 0) castbar:SetInside(overlayFrame, 0, 0)
else else
local iconWidth = cdb.icon and (castbar.Icon.bg:GetWidth() - unitframe.BORDER) or 0 local iconWidth = cdb.icon and (castbar.ButtonIcon.bg:GetWidth() - unitframe.BORDER) or 0
if(unitframe.ORIENTATION == "LEFT") then if(unitframe.ORIENTATION == "LEFT") then
castbar:SetPoint("TOPLEFT", overlayFrame, "TOPLEFT", iconWidth + unitframe.SPACING*3, 0) castbar:SetPoint("TOPLEFT", overlayFrame, "TOPLEFT", iconWidth + unitframe.SPACING*3, 0)
castbar:SetPoint("BOTTOMRIGHT", overlayFrame, "BOTTOMRIGHT") castbar:SetPoint("BOTTOMRIGHT", overlayFrame, "BOTTOMRIGHT")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment