From d0952a97fcff08328328d05f630d2b0036a48163 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Tue, 23 Jun 2015 12:24:35 -0400 Subject: fix multiple crash points if luaentity.entities or values returned from luaentity.add_entity() are nil --- item_transport.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'item_transport.lua') diff --git a/item_transport.lua b/item_transport.lua index fb9f626..7b64e7a 100644 --- a/item_transport.lua +++ b/item_transport.lua @@ -6,6 +6,7 @@ function pipeworks.tube_inject_item(pos, start_pos, velocity, item) -- Take item in any format local stack = ItemStack(item) local obj = luaentity.add_entity(pos, "pipeworks:tubed_item") + if not obj then return end obj:set_item(stack:to_string()) obj.start_pos = vector.new(start_pos) obj:setvelocity(velocity) -- cgit v1.2.3