From b51e9c6fdf1bdfbae2089d661a2d25cd4a8f35da Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Mon, 21 Mar 2016 11:30:25 +0100 Subject: [PATCH] bugfix for hyperlink delayed loading --- core.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/core.lua b/core.lua index d5db2a1..1eef595 100644 --- a/core.lua +++ b/core.lua @@ -96,7 +96,12 @@ function Aux.on_addon_loaded() local total_cost = 0 for i=1,reagent_count do - local item_id, suffix_id = Aux.info.parse_hyperlink(GetCraftReagentItemLink(id, i)) + local link = GetCraftReagentItemLink(id, i) + if not link then + total_cost = nil + break + end + local item_id, suffix_id = Aux.info.parse_hyperlink(link) local count = ({GetCraftReagentInfo(id, i)})[3] local _, price, limited = Aux.cache.merchant_info(item_id) local value = price and not limited and price or Aux.history.value(item_id..':'..suffix_id) @@ -123,7 +128,12 @@ function Aux.on_addon_loaded() local total_cost = 0 for i=1,reagent_count do - local item_id, suffix_id = Aux.info.parse_hyperlink(GetTradeSkillReagentItemLink(id, i)) + local link = GetTradeSkillReagentItemLink(id, i) + if not link then + total_cost = nil + break + end + local item_id, suffix_id = Aux.info.parse_hyperlink(link) local count = ({GetTradeSkillReagentInfo(id, i)})[3] local _, price, limited = Aux.cache.merchant_info(item_id) local value = price and not limited and price or Aux.history.value(item_id..':'..suffix_id)