Stackpack

5 - [Fix] Compare number with nil

Some items cause GetItemFamily() to give a nil itemfamily result. Kinda silly, but it does.

Interface/AddOns/Stackpack/Stackpack.lua:881 attempt to compare number with nil

I made the following change to fix it, relative to 3.0.1:

+++ Stackpack.lua	2011-03-31 10:59:25.000000000 -0700
@@ -878,7 +878,7 @@
 						if (ID ~= nil) then
 							local Item, Link, Quality, ItemLevel, RequiredLevel, itemType, otherType, Stack, equipLoc, Texture, Price = GetItemInfo(ID);
                             local ItemFamily = GetItemFamily(ID);
-							if (ItemFamily > 0) then
+							if (ItemFamily and ItemFamily > 0) then
 								local FreeSpace = GetContainerNumFreeSlots(i);
 								if (ItemFamily == SpecialBags[j].Type) then
                                     PickupContainerItem(c,s);


User When Change
peterwemm Apr 05, 2011 at 02:49 UTC Create

You must login to post a comment. Don't have an account? Register to get one!

Facts

Reported
Apr 05, 2011
Status
New - Issue has not had initial review yet.
Type
Patch - Source code patch for review
Priority
Medium - Normal priority.
Votes
0

Reported by

Possible assignees