summaryrefslogtreecommitdiff
path: root/pipeworks
diff options
context:
space:
mode:
Diffstat (limited to 'pipeworks')
-rw-r--r--pipeworks/lua_tube.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/pipeworks/lua_tube.lua b/pipeworks/lua_tube.lua
index 941ef92..689f74e 100644
--- a/pipeworks/lua_tube.lua
+++ b/pipeworks/lua_tube.lua
@@ -333,8 +333,11 @@ local safe_globals = {
}
local function create_environment(pos, mem, event)
- -- Gather variables for the environment
+ -- Make sure the tube hasn't broken.
local vports = minetest.registered_nodes[minetest.get_node(pos).name].virtual_portstates
+ if not vports then return {} end
+
+ -- Gather variables for the environment
local vports_copy = {}
for k, v in pairs(vports) do vports_copy[k] = v end
local rports = get_real_port_states(pos)