diff options
author | luk3yx <luk3yx@users.noreply.github.com> | 2019-01-16 10:31:07 +1300 |
---|---|---|
committer | luk3yx <luk3yx@users.noreply.github.com> | 2019-01-16 10:31:07 +1300 |
commit | dc8778d7d310fe8bcff778b8f768caa8a61a9f84 (patch) | |
tree | 590c6efc2a1b0e7252f0cbecac20c4a7e44816d6 | |
parent | 26e7b464155b4884155c9ffb6b3ff6fa4899f2cf (diff) | |
download | pipeworks-dc8778d7d310fe8bcff778b8f768caa8a61a9f84.tar pipeworks-dc8778d7d310fe8bcff778b8f768caa8a61a9f84.tar.gz pipeworks-dc8778d7d310fe8bcff778b8f768caa8a61a9f84.tar.bz2 pipeworks-dc8778d7d310fe8bcff778b8f768caa8a61a9f84.tar.xz pipeworks-dc8778d7d310fe8bcff778b8f768caa8a61a9f84.zip |
Fix crash when lua tubes are DoSed.
-rw-r--r-- | lua_tube.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lua_tube.lua b/lua_tube.lua index 941ef92..689f74e 100644 --- a/lua_tube.lua +++ b/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) |