From 47ec73e7e3d59313e0f5324eb6c61dc5cb31a5fe Mon Sep 17 00:00:00 2001 From: Ignifazius Date: Thu, 3 Sep 2015 23:29:20 +0200 Subject: [PATCH] fixing TradeSKillFrame = nil it seems, if you haven't opened the profession window, the TradeSkillFrame simply doesnt exist. If you found another item with ID = 0 this would case a lua-error, saying the TradeSkillFrame is nil. Solution: just check if it is already there. IMPORTANT: first check if nil, THEN check if visible --- BagSync.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BagSync.lua b/BagSync.lua index e6f1c39..35deb60 100644 --- a/BagSync.lua +++ b/BagSync.lua @@ -834,7 +834,7 @@ end local function AddItemToTooltip(frame, link) --workaround if (link) then local itemId = tonumber(string.match(link, "item:(%d+):")) -- get itemID // itemID seems to be "0" for every reagent in profession window?! - if (itemId == 0 and TradeSkillFrame:IsVisible()) then -- some other frames show ID = 0 aswell, so limit this workaround to the profession window + if (itemId == 0 and TradeSkillFrame ~= nil and TradeSkillFrame:IsVisible()) then -- some other frames show ID = 0 aswell, so limit this workaround to the profession window || IMPORTANT: TradeSkillFrame ~= nil has to be checked BEFORE TradeSkillFrame:IsVisible() local newItemId if ((GetMouseFocus():GetName()) == "TradeSkillSkillIcon") then --replace TradeSkill newItemId = tonumber(GetTradeSkillItemLink(TradeSkillFrame.selectedSkill):match("item:(%d+):")) -- 1.7.9.5