1
0
mirror of https://github.com/minetest-mods/3d_armor.git synced 2024-12-26 18:50:40 +01:00

Check that player inventory returns a valid table

This commit is contained in:
stujones11 2017-10-20 20:17:37 +01:00
parent d979815a49
commit d5896a04e2

View File

@ -199,7 +199,10 @@ armor.set_player_armor = function(self, player)
change[group] = 1
levels[group] = 0
end
local list = player_inv:get_list("armor") or {}
local list = player_inv:get_list("armor")
if type(list) ~= "table" then
return
end
for i, stack in pairs(list) do
if stack:get_count() == 1 then
local def = stack:get_definition()