From b92bf0a3e6c6bf1f69d2ead0bbc2a1560e846752 Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Sun, 20 Oct 2024 14:55:15 +0200 Subject: [PATCH] digiline: Prevent error upon ItemStack creation --- lua/controller.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/controller.lua b/lua/controller.lua index 720c3c9..2fda667 100644 --- a/lua/controller.lua +++ b/lua/controller.lua @@ -378,6 +378,10 @@ local function controller_on_digiline_receive(pos, _, channel, msg) return end + if msg and type(msg) ~= "string" and type(msg) ~= "table" then + return -- Protect against ItemStack(...) errors + end + local item = ItemStack(msg) local drawers_index = controller_get_drawer_index(pos, item:get_name())