From 9d0012b41e7aa11312e8f0666b9c05838ace2d3e Mon Sep 17 00:00:00 2001 From: pschifferer Date: Sun, 10 May 2009 04:42:58 +0000 Subject: [PATCH] Fixed a couple "nil" issues. --- CauldronUtil.lua | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) 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 -- 1.7.9.5