From d4b5367552464ea696b550660f4601be777620da Mon Sep 17 00:00:00 2001 From: Parnic Date: Sun, 12 Oct 2014 21:50:53 -0500 Subject: [PATCH] - Fixed an error when an item slot was specified that the user had no item equipped in. --- modules/CustomCDBar.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/CustomCDBar.lua b/modules/CustomCDBar.lua index 9792d1b..26f3e4d 100644 --- a/modules/CustomCDBar.lua +++ b/modules/CustomCDBar.lua @@ -670,9 +670,12 @@ function IceCustomCDBar.prototype:UpdateIcon() self.barFrame.icon:SetTexture(icon) end else - local name, _, _, _, _, _, _, _, _, texture = GetItemInfo(GetInventoryItemID("player", GetInventorySlotInfo(validInventorySlotNames[self.moduleSettings.itemToTrack]))) - if name and texture then - self.barFrame.icon:SetTexture(texture) + local itemId = GetInventoryItemID("player", GetInventorySlotInfo(validInventorySlotNames[self.moduleSettings.itemToTrack])) + if itemId then + local name, _, _, _, _, _, _, _, _, texture = GetItemInfo(itemId) + if name and texture then + self.barFrame.icon:SetTexture(texture) + end end end