bags: skip invalid bagslots

This commit is contained in:
shagu
2019-03-31 14:59:21 +02:00
parent f02f6d267e
commit f13b84565f
+1 -1
View File
@@ -98,7 +98,7 @@ pfUI:RegisterModule("bags", function ()
local bagsize = GetContainerNumSlots(bag)
if bag == -2 and pfUI.bag.showKeyring == true then bagsize = GetKeyRingSize() end
for slot=1, bagsize do
if pfUI.bags[bag].slots[slot].frame:IsShown() then
if pfUI.bags[bag] and pfUI.bags[bag].slots[slot] and pfUI.bags[bag].slots[slot].frame:IsShown() then
local _, _, locked, _ = GetContainerItemInfo(bag, slot)
SetItemButtonDesaturated(pfUI.bags[bag].slots[slot].frame, locked, 0.5, 0.5, 0.5)
end