Skip to content

Commit c04c106

Browse files
committed
prevent unexpected nil comparison in AutoGearConsiderItem
1 parent 721fd16 commit c04c106

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

AutoGear.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4153,9 +4153,9 @@ function AutoGearDetermineItemScore(info)
41534153
end
41544154
if info.classID == Enum.ItemClass.Container then
41554155
if info.subclassID == 0 then -- generic (typical) bag; there's no Enum.ItemContainerSubclass
4156-
return info.numBagSlots
4156+
return info.numBagSlots or 0
41574157
else
4158-
return info.numBagSlots * E -- specialized bags suck, so consider them only better than nothing
4158+
return (info.numBagSlots or 0) * E -- specialized bags suck, so consider them only better than nothing
41594159
end
41604160
elseif info.isAmmoBag and info.numBagSlots and (UnitClassBase("player") == "HUNTER") then
41614161
return info.numBagSlots + (info.ammoBagRangedAttackSpeed and info.ammoBagRangedAttackSpeed or 0)
@@ -4168,7 +4168,7 @@ function AutoGearDetermineItemScore(info)
41684168
if score == 0 then
41694169
return E
41704170
else
4171-
return score
4171+
return score or 0
41724172
end
41734173
end
41744174
end
@@ -4213,7 +4213,7 @@ function AutoGearDetermineItemScore(info)
42134213
if score == 0 then
42144214
return E
42154215
else
4216-
return score
4216+
return score or 0
42174217
end
42184218
end
42194219

0 commit comments

Comments
 (0)