Quantcast

Fixed a couple "nil" issues.

pschifferer [05-10-09 - 04:42]
Fixed a couple "nil" issues.
Filename
CauldronUtil.lua
diff --git a/CauldronUtil.lua b/CauldronUtil.lua
index fbb2cf2..e43942f 100644
--- a/CauldronUtil.lua
+++ b/CauldronUtil.lua
@@ -158,9 +158,11 @@ function Cauldron:ScanBags()
 			local link = GetContainerItemLink(bagid, i);
 			if link then
 				local name = Cauldron:GetNameFromLink(link);
-				local count = GetItemCount(link);
-
-				self.vars.inventory[name] = count;
+				if name then
+					local count = GetItemCount(link);
+
+					self.vars.inventory[name] = count;
+				end
 			end
 		end
 	end
@@ -186,17 +188,19 @@ function Cauldron:GetItemDeltas(bagid)
 		local link = GetContainerItemLink(bagid, i);
 		if link then
 			local name = Cauldron:GetNameFromLink(link);
-			local count = GetItemCount(link);
-			-- local count = select(2, {GetContainerItemInfo(bagid, i)});
-
-			local delta = count;
-			if inv[name] then
-				delta = count - inv[name];
-			end
-
-			if delta ~= 0 then
-				-- save the delta information
-				deltas[name] = delta;
+			if name then
+				local count = GetItemCount(link);
+				-- local count = select(2, {GetContainerItemInfo(bagid, i)});
+
+				local delta = count;
+				if inv[name] then
+					delta = count - inv[name];
+				end
+
+				if delta ~= 0 then
+					-- save the delta information
+					deltas[name] = delta;
+				end
 			end
 		end
 	end