From b70ab2f8725ebe55d50a18f71c3a859bd3691923 Mon Sep 17 00:00:00 2001 From: andrew6180 <16847730+andrew6180@users.noreply.github.com> Date: Fri, 15 Nov 2024 17:47:26 -0700 Subject: [PATCH] Core/Cooldowns: fix cooldown lua error --- ElvUI/Core/Cooldowns.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ElvUI/Core/Cooldowns.lua b/ElvUI/Core/Cooldowns.lua index a9ca6de..f3c4bc3 100644 --- a/ElvUI/Core/Cooldowns.lua +++ b/ElvUI/Core/Cooldowns.lua @@ -167,7 +167,7 @@ end function E:CreateCooldownTimer(parent, displayParent) local timer = CreateFrame("Frame", parent:GetName() and parent:GetName().."Timer" or nil, displayParent) - parent:HookScript("OnHide", function(self) if self:GetParent().isNamePlate then return end timer:Hide() end) + parent:HookScript("OnHide", function(self) local parent = self:GetParent() if parent and parent.isNamePlate then return end timer:Hide() end) parent:HookScript("OnShow", function(self) timer:Show() end) timer:SetFrameLevel(parent:GetFrameLevel() + 1) timer:Hide() @@ -221,7 +221,7 @@ end function E:RegisterCooldown(cooldown, module) if not cooldown.isHooked then hooksecurefunc(cooldown, "SetCooldown", E.OnSetCooldown) - if cooldown:GetParent().isNamePlate then + if cooldown:GetParent() and cooldown:GetParent().isNamePlate then cooldown.Show = cooldown.Hide cooldown:Hide() end