From 38c80d28c0525e71e4a981294b02be0b2ca0272b Mon Sep 17 00:00:00 2001 From: shagu Date: Sun, 17 Jul 2022 22:49:16 +0200 Subject: [PATCH] cooldown-numbers: check frame before using it --- mods/cooldown-numbers.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/mods/cooldown-numbers.lua b/mods/cooldown-numbers.lua index 9302126..edcf354 100644 --- a/mods/cooldown-numbers.lua +++ b/mods/cooldown-numbers.lua @@ -76,14 +76,16 @@ local function SetCooldown(this, start, duration, enable) CreateCoolDown(this, start, duration) end - if start > 0 and duration > 0 and (not enable or enable > 0) then - this.cooldowntext:Show() - else - this.cooldowntext:Hide() - end + if this.cooldowntext then + if start > 0 and duration > 0 and (not enable or enable > 0) then + this.cooldowntext:Show() + else + this.cooldowntext:Hide() + end - this.cooldowntext.start = start - this.cooldowntext.duration = duration + this.cooldowntext.start = start + this.cooldowntext.duration = duration + end end module.enable = function(self)