Fixed loot window error

Yaron Kfir [05-28-14 - 13:29]
Fixed loot window error
Filename
Changelog
PriceTracker.lua
diff --git a/Changelog b/Changelog
index 4b00d0b..f4c2008 100644
--- a/Changelog
+++ b/Changelog
@@ -1,12 +1,10 @@
 Changelog

-v0.2
- - Fixed 'Research Trait from Item' window error
- - Display integers, ignore fractions
- - Added min / max prices
- - Suggested prices per item and per stack are displayed in separate lines
- - Added number of times seen in guild stores
- - Minor cosmetic and code fixes
+v0.5
+ - Fixed loot window error
+
+ v0.4
+ - Added missing default values

 v0.3
  - Added settings menu
@@ -14,5 +12,10 @@ v0.3
  - Number of times item seen in stores can be turned off
  - Min / max can be turned off

- v0.4
- - Added missing default values
+v0.2
+ - Fixed 'Research Trait from Item' window error
+ - Display integers, ignore fractions
+ - Added min / max prices
+ - Suggested prices per item and per stack are displayed in separate lines
+ - Added number of times seen in guild stores
+ - Minor cosmetic and code fixes
diff --git a/PriceTracker.lua b/PriceTracker.lua
index 20413b1..19379d8 100644
--- a/PriceTracker.lua
+++ b/PriceTracker.lua
@@ -72,6 +72,10 @@ function PriceTracker:OnUpdateTooltip(item)
 	end

 	self.selectedItem = item
+	local stackCount = item.dataEntry.data.stackCount or item.dataEntry.data.stack
+	if not stackCount then
+		return
+	end

 	local matches = self:GetMatches(item.dataEntry.data.name)
 	if not matches then
@@ -86,7 +90,6 @@ function PriceTracker:OnUpdateTooltip(item)
 	ZO_Tooltip_AddDivider(ItemTooltip)
 	ItemTooltip:AddLine("Price Tracker", "ZoFontHeader2")
 	local r, g, b = ZO_TOOLTIP_DEFAULT_COLOR:UnpackRGB()
-	local stackCount = item.dataEntry.data.stackCount or item.dataEntry.data.stack
 	ItemTooltip:AddLine("Suggested Price: |r", "ZoFontGame", r, g, b, TOPLEFT, MODIFY_TEXT_TYPE_NONE, LEFT, false)
 	ItemTooltip:AddLine(self:FormatTooltipLine("Item price: ", price, stackCount), "ZoFontGame", r, g, b, CENTER, MODIFY_TEXT_TYPE_NONE, CENTER, false)
 	if stackCount > 1 then
@@ -128,6 +131,7 @@ function PriceTracker:OnSearchResultsReceived(eventId, guildId, numItemsOnPage,

 	for i = 1, numItemsOnPage do
 		self:AddItem(GetTradingHouseSearchResultItemInfo(i))
+		d(GetStoreItemLink(i, LINKE_STYLE_DEFAULT))
 	end

 	if hasMorePages then