Skip to content

Commit 30ec375

Browse files
committed
Fix error when using an invalid spell with a custom bar on 11.x
1 parent 73891bc commit 30ec375

File tree

6 files changed

+36
-4
lines changed

6 files changed

+36
-4
lines changed

changelog.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
v1.15.5:
4+
5+
- Fix error when using an invalid spell with a custom bar on 11.x
6+
37
v1.15.4:
48

59
- Update TOC for TWW

modules/CustomBar.lua

+7-1
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,14 @@ end
2020
local GetSpellInfo = GetSpellInfo
2121
if not GetSpellInfo and C_Spell and C_Spell.GetSpellInfo then
2222
GetSpellInfo = function(id)
23+
if not id then
24+
return nil
25+
end
26+
2327
local info = C_Spell.GetSpellInfo(id)
24-
return info.name, nil, info.iconID
28+
if info then
29+
return info.name, nil, info.iconID
30+
end
2531
end
2632
end
2733

modules/CustomCDBar.lua

+7-1
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,14 @@ end
3030
local GetSpellInfo = GetSpellInfo
3131
if not GetSpellInfo and C_Spell and C_Spell.GetSpellInfo then
3232
GetSpellInfo = function(id)
33+
if not id then
34+
return nil
35+
end
36+
3337
local info = C_Spell.GetSpellInfo(id)
34-
return info.name, nil, info.iconID
38+
if info then
39+
return info.name, nil, info.iconID
40+
end
3541
end
3642
end
3743

modules/CustomCounterBar.lua

+7-1
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,14 @@ local DefaultAuraIcon = "Interface\\Icons\\Spell_Frost_Frost"
1010
local GetSpellInfo = GetSpellInfo
1111
if not GetSpellInfo and C_Spell and C_Spell.GetSpellInfo then
1212
GetSpellInfo = function(id)
13+
if not id then
14+
return nil
15+
end
16+
1317
local info = C_Spell.GetSpellInfo(id)
14-
return info.name, nil, info.iconID
18+
if info then
19+
return info.name, nil, info.iconID
20+
end
1521
end
1622
end
1723

modules/GlobalCoolDown.lua

+7-1
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,14 @@ end
99
local GetSpellInfo = GetSpellInfo
1010
if not GetSpellInfo and C_Spell and C_Spell.GetSpellInfo then
1111
GetSpellInfo = function(id)
12+
if not id then
13+
return nil
14+
end
15+
1216
local info = C_Spell.GetSpellInfo(id)
13-
return info.name, nil, info.iconID, info.castTime
17+
if info then
18+
return info.name, nil, info.iconID, info.castTime
19+
end
1420
end
1521
end
1622

this_version.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
v1.15.5:
4+
5+
- Fix error when using an invalid spell with a custom bar on 11.x
6+
37
v1.15.4:
48

59
- Update TOC for TWW

0 commit comments

Comments
 (0)