Quantcast

Fixed a nil error that came up when using TipTac

Kevin Lyles [11-22-10 - 16:39]
Fixed a nil error that came up when using TipTac
Updated version to 1.3r4
Filename
WeightsWatcher.lua
WeightsWatcher.toc
diff --git a/WeightsWatcher.lua b/WeightsWatcher.lua
index 1904ad2..6b846bf 100644
--- a/WeightsWatcher.lua
+++ b/WeightsWatcher.lua
@@ -585,9 +585,23 @@ function WeightsWatcher.displayItemStats(tooltip, ttname)
 			start = 2
 		end

+		local offset = 0
 		for i = start, tooltip:NumLines() do
-			ttleft = _G[ttname .. "TextLeft" .. i]
-			origTextL = ttleft:GetText()
+			while true do
+				ttleft = _G[ttname .. "TextLeft" .. i + offset]
+				if ttleft == nil then
+					break
+				end
+				origTextL = ttleft:GetText()
+				if origTextL == nil then
+					offset = offset + 1
+				else
+					break
+				end
+			end
+			if ttleft == nil or origTextL == nil then
+				break
+			end
 			textL = WeightsWatcher.preprocess(origTextL:lower())
 			if rawget(ww_unparsed_lines, textL) then
 				if showDebugInfo then
diff --git a/WeightsWatcher.toc b/WeightsWatcher.toc
index 017f42c..e8ecb74 100644
--- a/WeightsWatcher.toc
+++ b/WeightsWatcher.toc
@@ -2,7 +2,7 @@
 ## Title: Weights Watcher
 ## Notes: Ranks gear according to customizable stat weights
 ## Author: The Flying Squirrels
-## Version: 1.3r3
+## Version: 1.3r4
 ## OptionalDeps: AtlasLoot
 ## SavedVariables: ww_vars
 ## SavedVariablesPerCharacter: ww_charVars