Majillions of "comparison to nil" errors in ReagentSearch/Main.lua
Debuggernaut opened this issue ยท 1 comments
Hey dudes, I was getting a ton of errors in the ReagentSearch section when I updated after a few weeks
I ended up adding a bunch of nil checks to work around it, here they are if you want to pull them in:
function Auctionator.ReagentSearch.GetSkillReagentsTotal()
local total = 0
local recipeIndex = TradeSkillFrame.RecipeList:GetSelectedRecipeID()
if recipeIndex == nil then
return 0
end
for reagentIndex = 1, C_TradeSkillUI.GetRecipeNumReagents(recipeIndex) do
local multiplier = select(3, C_TradeSkillUI.GetRecipeReagentInfo(recipeIndex, reagentIndex))
local link = select(1, C_TradeSkillUI.GetRecipeReagentItemLink(recipeIndex, reagentIndex))
local price = Auctionator.API.v1.GetAuctionPriceByItemLink(AUCTIONATOR_L_REAGENT_SEARCH, link)
if total ~= nil and multiplier ~= nil and price ~= nil then
total = total + multiplier * price
end
end
return total
end
BTW, the mandatory "What's New" popup with every update to this addon is really infuriating. It's probably the most obnoxious thing any addon I use does. You should seriously consider only doing that when something really face-smashingly important changes, because it's damn annoying.
Anyway, keep up the good work otherwise, love the addon in general