make sure inventory exists before updating lists

This commit is contained in:
Jordan Irwin 2021-07-12 23:02:50 -07:00
parent e81ed836dc
commit 5fcc824d0e

View File

@ -181,9 +181,14 @@ core.register_chatcommand(cmd_repo.node.cmd_rem, {
}) })
local function update_list(inv, listname, src, tgt) local function update_list(inv, listname, src, tgt)
if not inv then
cleaner.log("error", "cannot update list of unknown inventory")
return
end
local list = inv:get_list(listname) local list = inv:get_list(listname)
if not list then if not list then
cleaner.log("warning", "unknown player list: " .. listname) cleaner.log("warning", "unknown inventory list: " .. listname)
return return
end end