From 5fcc824d0e88fa1ca1fbccd1d775c9590f9ccf23 Mon Sep 17 00:00:00 2001 From: Jordan Irwin Date: Mon, 12 Jul 2021 23:02:50 -0700 Subject: [PATCH] make sure inventory exists before updating lists --- chat.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/chat.lua b/chat.lua index 25542cd..5f9c4f8 100644 --- a/chat.lua +++ b/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