Skip to content

Commit 454da62

Browse files
committed
nPower: Handle GetRuneCooldown() returning start=nil
Fixes #294 Fixes #301
1 parent 1824858 commit 454da62

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Interface/AddOns/nPower/core.lua

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,18 @@ end
1010

1111
local function CalcRuneCooldown(num)
1212
local start, duration, runeReady = GetRuneCooldown(num)
13+
14+
-- Sometimes GetRuneCooldown returns nil for some reason.
15+
if not start then
16+
return
17+
end
18+
1319
local time = floor(GetTime() - start)
1420
local cooldown = ceil(duration - time)
1521

16-
if (runeReady or UnitIsDeadOrGhost("player")) then
22+
if runeReady or UnitIsDeadOrGhost("player") then
1723
return "#"
18-
elseif (not UnitIsDeadOrGhost("player") and cooldown) then
24+
elseif not UnitIsDeadOrGhost("player") and cooldown then
1925
return cooldown
2026
end
2127
end

0 commit comments

Comments
 (0)