Fix crash if stack == nil

This commit is contained in:
Zemtzov7 2024-03-03 19:41:09 +05:00 committed by GitHub
parent f0e8b5c604
commit fe719aa204
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -37,6 +37,9 @@ local function im_fs(name)
"label[0,0;"..target[name].."]".. "label[0,0;"..target[name].."]"..
"checkbox["..(W-2)..",-0.2;grab_mode;Grab item;"..(grab_mode[name] and grab_mode[name] or "false").."]" "checkbox["..(W-2)..",-0.2;grab_mode;Grab item;"..(grab_mode[name] and grab_mode[name] or "false").."]"
for number,stack in pairs(inv:get_list(ilist[(tab[name] or 1)])) do for number,stack in pairs(inv:get_list(ilist[(tab[name] or 1)])) do
if not stack then
stack = ItemStack("")
end
local name = stack:get_name() local name = stack:get_name()
local count = stack:get_count() local count = stack:get_count()
local descr = stack:get_short_description() local descr = stack:get_short_description()