diff Modules/DisplayInvested.lua @ 159:fbfd9dfa6d2b tip

[mq]: minorStuff
author Asa Ayers <Asa.Ayers@Gmail.com>
date Sun, 09 Jan 2011 07:38:22 -0800
parents 106c1523777e
children
line wrap: on
line diff
--- a/Modules/DisplayInvested.lua	Wed Dec 15 23:15:17 2010 -0800
+++ b/Modules/DisplayInvested.lua	Sun Jan 09 07:38:22 2011 -0800
@@ -192,7 +192,14 @@
 		
 		for itemID, count in pairs(inventory.items) do
 			if includedItems[itemID] == nil then
+				assert(itemID ~= 0, 'Invalid ItemID. Something may be wrong in the inventory scanner.')
 				local itemName, link = GetItemInfo(itemID)
+				if not link then
+					-- we can't continue without a link, but sometimes blizzard just fails to return one.
+					ItemAuditor:Print("GetItemInfo failed to return an item link for %s (ID: %s). Retrying in 1 second.", tostring(itemName), tostring(itemID))
+					return ItemAuditor:ScheduleTimer(UpdateInvestedData, 1)
+				end
+				assert(link, format("failed to get link for %s:%s", tostring(itemID), tostring(itemName)))
 				local count = ItemAuditor:GetItemCount(itemID)
 				tableData[i] = {
 					itemName.."|"..link,