From ff14b8186ec2eb01cb2a6a1606e7d12ab0188678 Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Sun, 17 Aug 2008 13:42:30 +0000 Subject: [PATCH] Fix an error that can occur when only one trinket slot has a winner --- DressToKill.lua | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/DressToKill.lua b/DressToKill.lua index 624edcd..c7056b1 100644 --- a/DressToKill.lua +++ b/DressToKill.lua @@ -296,11 +296,14 @@ local function scanFunction(weightFunction) debug(L["Item blacklisted, skipping..."]) end end - -- Now equip the item that won this round and blacklist - DressToKill:EquipItem(slotId, winner, stash) - local link = GetInventoryItemLink("player", slotId) - print("Choosing %s", link) - blacklist[winner] = true + -- Now equip the item that won this round and blacklist assuming there was a winner + if winner then + DressToKill:EquipItem(slotId, winner, stash) + local link = GetInventoryItemLink("player", slotId) + debug(L["Choosing %s for this slot"], link) + blacklist[winner] = true + else + debug(L["There was no winner from this round, not enough trinkets or rings?"]) end UIErrorsFrame:AddMessage("Scan complete!", 0.2, 1, 0.2) print("Evaluation complete!") -- 1.7.9.5