Skip to content

Commit 97337eb

Browse files
committed
prevent possible nil comparison on load before best-items table is updated
1 parent c839c23 commit 97337eb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

AutoGear.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3022,7 +3022,7 @@ function AutoGearConsiderItem(info, bag, slot, rollOn, chooseReward)
30223022
if info.isGear and info.validGearSlots then
30233023
local firstValidGearSlot = info.validGearSlots[1]
30243024
local lowestScoringValidGearSlot = firstValidGearSlot
3025-
local lowestScoringValidGearSlotScore = AutoGearBestItems[firstValidGearSlot].score
3025+
local lowestScoringValidGearSlotScore = AutoGearBestItems[firstValidGearSlot].score or 0
30263026
for _, gearSlot in pairs(info.validGearSlots) do
30273027
local skipThisSlot = false
30283028
for _, otherGearSlot in pairs(info.validGearSlots) do
@@ -3035,6 +3035,7 @@ function AutoGearConsiderItem(info, bag, slot, rollOn, chooseReward)
30353035
if not skipThisSlot and
30363036
((not AutoGearBestItems[gearSlot]) or
30373037
(AutoGearBestItems[gearSlot].info.empty or
3038+
(not AutoGearBestItems[gearSlot].score) or
30383039
(AutoGearBestItems[gearSlot].score < lowestScoringValidGearSlotScore))) then
30393040
lowestScoringValidGearSlot = gearSlot
30403041
lowestScoringValidGearSlotScore = AutoGearBestItems[gearSlot] and AutoGearBestItems[gearSlot].score or 0

0 commit comments

Comments
 (0)