Fix crash when lua tubes are DoSed.

This commit is contained in:
luk3yx 2019-01-16 10:31:07 +13:00
parent 26e7b46415
commit dc8778d7d3

@ -333,8 +333,11 @@ local safe_globals = {
} }
local function create_environment(pos, mem, event) 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 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 = {} local vports_copy = {}
for k, v in pairs(vports) do vports_copy[k] = v end for k, v in pairs(vports) do vports_copy[k] = v end
local rports = get_real_port_states(pos) local rports = get_real_port_states(pos)