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

This commit is contained in:
Parnic
2024-08-14 11:34:54 -05:00
parent 73891bca4b
commit 30ec3750c1
6 changed files with 36 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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