mirror of
https://codeberg.org/AntumLuanti/mod-cleaner.git
synced 2025-03-15 04:41:22 +00:00
make sure inventory exists before updating lists
This commit is contained in:
parent
e81ed836dc
commit
5fcc824d0e
1 changed files with 6 additions and 1 deletions
7
chat.lua
7
chat.lua
|
@ -181,9 +181,14 @@ core.register_chatcommand(cmd_repo.node.cmd_rem, {
|
|||
})
|
||||
|
||||
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)
|
||||
if not list then
|
||||
cleaner.log("warning", "unknown player list: " .. listname)
|
||||
cleaner.log("warning", "unknown inventory list: " .. listname)
|
||||
return
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue