From 7ca2df2dc41c4a5aaf71784c30bfdf7d1a8d2298 Mon Sep 17 00:00:00 2001 From: Alex Folland Date: Sat, 31 Jul 2021 15:58:47 -0700 Subject: [PATCH] prevent errors from nil DR icons --- Modules/Diminishings.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Modules/Diminishings.lua b/Modules/Diminishings.lua index 9c3b00b..ddfaf75 100644 --- a/Modules/Diminishings.lua +++ b/Modules/Diminishings.lua @@ -645,7 +645,12 @@ function Diminishings:GetDRIcons(category) local icons = {} for k,v in pairs(DRData:GetSpells()) do if v == category then - icons[select(3, GetSpellInfo(k))] = format("|T%s:20|t %s", select(3, GetSpellInfo(k)), select(1, GetSpellInfo(k))) + local icon = select(3, GetSpellInfo(k)) + if icon then + icons[icon] = format("|T%s:20|t %s", tostring(icon or "nil"), tostring(select(1, GetSpellInfo(k)) or "nil")) + else + print("Gladdy Diminishings.lua: nil icon for key: "..tostring(k or "nil").."; value: "..tostring(v or "nil")) + end end end return icons