Added tostring() call around some potentially nil values.
pschifferer [11-04-09 - 04:21]
Added tostring() call around some potentially nil values.
diff --git a/CauldronTradeskill.lua b/CauldronTradeskill.lua
index c643c8f..a599b66 100644
--- a/CauldronTradeskill.lua
+++ b/CauldronTradeskill.lua
@@ -162,16 +162,12 @@ function Cauldron:UpdateSkills()
local num = GetTradeSkillNumReagents(i);
for j=1,num do
local rName, rIcon, rCount, _ = GetTradeSkillReagentInfo(i, j);
--- Cauldron:info("UpdateSkills: i="..i..", j="..j..", rName="..tostring(rName)..", rIcon="..tostring(rIcon)..", rCount="..tostring(rCount));
local rLink = GetTradeSkillReagentItemLink(i, j);
--- Cauldron:info("UpdateSkills: rLink="..tostring(rLink));
local rItemId = Cauldron:GetIdFromLink(rLink);
--- Cauldron:info("UpdateSkills: rItemId="..tostring(rItemId));
local key = not Cauldron:IsVendorItem(rItemId);
--- Cauldron:info("UpdateSkills: key="..tostring(key));
if (not rName) or (not rIcon) or (not rLink) then
- Cauldron:error("Can't get name/icon/link for reagent! (skill: "..name..", reagentIndex: "..j..", name: "..rName..", icon: "..rIcon..", link: "..rLink..")");
+ Cauldron:error("Can't get name/icon/link for reagent! (skill: "..name..", reagentIndex: "..j..", name: "..tostring(rName)..", icon: "..tostring(rIcon)..", link: "..tostring(rLink)..")");
end
local r = {
@@ -194,9 +190,7 @@ function Cauldron:UpdateSkills()
end
table.insert(self.db.realm.userdata[self.vars.playername].reagentMap[rName], skillName..";"..recipeLink);
--- Cauldron:info("adding to keywords: "..tostring(keywords));
keywords = keywords..","..rName;
--- Cauldron:info("keywords="..tostring(keywords));
end
end