controller: Add nil check in for digiline pipeworks injection (#49)

Co-authored-by: BuckarooBanzay <BuckarooBanzay@users.noreply.github.com>
This commit is contained in:
Buckaroo Banzai 2020-06-25 12:11:20 +02:00 committed by GitHub
parent b97e905bc2
commit 6603f27279
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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)
-- 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)