ElvUI Enhanced Again (DF)

ElvUI Enhanced Again (DF)

1M Downloads

Error for Bags, table expected, got nil

Malkymder opened this issue ยท 2 comments

commented

2x ...rfaceElvUI_Enhanced\modules\bags\baginfo.lua:54: bad argument #1 to 'pairs' (table expected, got nil)
[C]: in function pairs' ...rfaceElvUI_Enhanced\modules\bags\baginfo.lua:54: in function BuildEquipmentMap'
...rfaceElvUI_Enhanced\modules\bags\baginfo.lua:91: in function `?'
ElvUI\Libraries\AceTimer-3.0\AceTimer-3.0-17.lua:55: in function <ElvUI\Libraries\AceTimer-3.0\AceTimer-3.0.lua:50>

Locals:
(*temporary) = nil
(*temporary) = "table expected, got nil"
= defined =[C]:-1

Happens mostly when i equip stuff from my bags

Fixed it using the following code but don't know if it causes more issues or not

        if infoArray then -- <---- check if not null
    		for _, location in pairs(infoArray) do
    			if location < -1 or location > 1 then
    				player, bank, bags, _, slot, bag = EquipmentManager_UnpackLocation(location)
    				if ((bank or bags) and slot and bag) then
    					key = MapKey(bag, slot)
    					equipmentMap[key] = equipmentMap[key] or {}
    					tinsert(equipmentMap[key], name)
    				end
    			end
    		end
        end
commented

Also would like to note that this only occurs if something is added or moved in the bags

commented

Ah, I forgot about this one, sorry. I'll see if I can find some time in between work, family and raiding :)