mirror of
https://github.com/minetest-mods/drawers.git
synced 2024-12-22 20:42:22 +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,7 +390,10 @@ 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)
|
||||
|
||||
pipeworks.tube_inject_item(pos, pos, dir, taken_stack:to_string())
|
||||
-- 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)
|
||||
|
Loading…
Reference in New Issue
Block a user