From a236cc9b6ee0843c00cae74b4ebd59f535bece62 Mon Sep 17 00:00:00 2001 From: shagu Date: Mon, 22 Apr 2019 04:32:26 +0200 Subject: [PATCH] libcast: check for icon field before using it --- libs/libcast.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/libcast.lua b/libs/libcast.lua index 747918b4..13af06ae 100644 --- a/libs/libcast.lua +++ b/libs/libcast.lua @@ -178,7 +178,7 @@ libcast:RegisterEvent("PLAYER_TARGET_CHANGED") libcast:SetScript("OnEvent", function() -- Fill database with player casts if event == "SPELLCAST_START" then - local icon = L["spells"][arg1] and string.format("%s%s", "Interface\\Icons\\", L["spells"][arg1].icon) or texture + local icon = L["spells"][arg1] and L["spells"][arg1].icon and string.format("%s%s", "Interface\\Icons\\", L["spells"][arg1].icon) or texture -- add cast action to the database this.db[player].cast = arg1 this.db[player].start = GetTime() @@ -211,7 +211,7 @@ libcast:SetScript("OnEvent", function() this.db[player].cast = arg2 this.db[player].start = GetTime() this.db[player].casttime = arg1 - this.db[player].icon = L["spells"][arg2] and string.format("%s%s", "Interface\\Icons\\", L["spells"][arg2].icon) or texture + this.db[player].icon = L["spells"][arg2] and L["spells"][arg2].icon and string.format("%s%s", "Interface\\Icons\\", L["spells"][arg2].icon) or texture this.db[player].channel = true texture = nil elseif event == "SPELLCAST_CHANNEL_STOP" then