Skip to content

Commit

Permalink
Fix error when using an invalid spell with a custom bar on 11.x
Browse files Browse the repository at this point in the history
  • Loading branch information
parnic committed Aug 14, 2024
1 parent 73891bc commit 30ec375
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 4 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

v1.15.5:

- Fix error when using an invalid spell with a custom bar on 11.x

v1.15.4:

- Update TOC for TWW
Expand Down
8 changes: 7 additions & 1 deletion modules/CustomBar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,14 @@ end
local GetSpellInfo = GetSpellInfo
if not GetSpellInfo and C_Spell and C_Spell.GetSpellInfo then
GetSpellInfo = function(id)
if not id then
return nil
end

local info = C_Spell.GetSpellInfo(id)
return info.name, nil, info.iconID
if info then
return info.name, nil, info.iconID
end
end
end

Expand Down
8 changes: 7 additions & 1 deletion modules/CustomCDBar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,14 @@ end
local GetSpellInfo = GetSpellInfo
if not GetSpellInfo and C_Spell and C_Spell.GetSpellInfo then
GetSpellInfo = function(id)
if not id then
return nil
end

local info = C_Spell.GetSpellInfo(id)
return info.name, nil, info.iconID
if info then
return info.name, nil, info.iconID
end
end
end

Expand Down
8 changes: 7 additions & 1 deletion modules/CustomCounterBar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ local DefaultAuraIcon = "Interface\\Icons\\Spell_Frost_Frost"
local GetSpellInfo = GetSpellInfo
if not GetSpellInfo and C_Spell and C_Spell.GetSpellInfo then
GetSpellInfo = function(id)
if not id then
return nil
end

local info = C_Spell.GetSpellInfo(id)
return info.name, nil, info.iconID
if info then
return info.name, nil, info.iconID
end
end
end

Expand Down
8 changes: 7 additions & 1 deletion modules/GlobalCoolDown.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@ end
local GetSpellInfo = GetSpellInfo
if not GetSpellInfo and C_Spell and C_Spell.GetSpellInfo then
GetSpellInfo = function(id)
if not id then
return nil
end

local info = C_Spell.GetSpellInfo(id)
return info.name, nil, info.iconID, info.castTime
if info then
return info.name, nil, info.iconID, info.castTime
end
end
end

Expand Down
4 changes: 4 additions & 0 deletions this_version.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

v1.15.5:

- Fix error when using an invalid spell with a custom bar on 11.x

v1.15.4:

- Update TOC for TWW
Expand Down

0 comments on commit 30ec375

Please sign in to comment.