From 30ec3750c1519207571e97d6a8bbfa3653646053 Mon Sep 17 00:00:00 2001 From: Parnic Date: Wed, 14 Aug 2024 11:34:54 -0500 Subject: [PATCH] Fix error when using an invalid spell with a custom bar on 11.x --- changelog.md | 4 ++++ modules/CustomBar.lua | 8 +++++++- modules/CustomCDBar.lua | 8 +++++++- modules/CustomCounterBar.lua | 8 +++++++- modules/GlobalCoolDown.lua | 8 +++++++- this_version.md | 4 ++++ 6 files changed, 36 insertions(+), 4 deletions(-) diff --git a/changelog.md b/changelog.md index 3801abc..5404df3 100644 --- a/changelog.md +++ b/changelog.md @@ -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 diff --git a/modules/CustomBar.lua b/modules/CustomBar.lua index 2dbef8b..3b11b11 100644 --- a/modules/CustomBar.lua +++ b/modules/CustomBar.lua @@ -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 diff --git a/modules/CustomCDBar.lua b/modules/CustomCDBar.lua index 9191b20..727c083 100644 --- a/modules/CustomCDBar.lua +++ b/modules/CustomCDBar.lua @@ -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 diff --git a/modules/CustomCounterBar.lua b/modules/CustomCounterBar.lua index ab59faa..6b6ca56 100644 --- a/modules/CustomCounterBar.lua +++ b/modules/CustomCounterBar.lua @@ -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 diff --git a/modules/GlobalCoolDown.lua b/modules/GlobalCoolDown.lua index 55dabd6..bae50c6 100644 --- a/modules/GlobalCoolDown.lua +++ b/modules/GlobalCoolDown.lua @@ -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 diff --git a/this_version.md b/this_version.md index b310176..bf49620 100644 --- a/this_version.md +++ b/this_version.md @@ -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