Skip to content

Commit

Permalink
digiline: Prevent error upon ItemStack creation
Browse files Browse the repository at this point in the history
  • Loading branch information
SmallJoker committed Oct 20, 2024
1 parent c0b2a20 commit b92bf0a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lua/controller.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down

0 comments on commit b92bf0a

Please sign in to comment.