mirror of
https://github.com/minetest-mods/drawers.git
synced 2024-11-25 16:13:45 +01:00
controller: Add nil check in for digiline pipeworks injection (#49)
Co-authored-by: BuckarooBanzay <BuckarooBanzay@users.noreply.github.com>
This commit is contained in:
parent
b97e905bc2
commit
6603f27279
@ -390,8 +390,11 @@ local function controller_on_digiline_receive(pos, _, channel, msg)
|
||||
local taken_stack = drawers.drawer_take_item(drawers_index[item:get_name()]["drawer_pos"], item)
|
||||
local dir = core.facedir_to_dir(core.get_node(pos).param2)
|
||||
|
||||
-- prevent crash if taken_stack ended up with a nil value
|
||||
if taken_stack then
|
||||
pipeworks.tube_inject_item(pos, pos, dir, taken_stack:to_string())
|
||||
end
|
||||
end
|
||||
|
||||
local function controller_on_receive_fields(pos, formname, fields, sender)
|
||||
local meta = core.get_meta(pos)
|
||||
|
Loading…
Reference in New Issue
Block a user