From 659a8acb0db01601c8475439ca4b6bd9bff8c63e Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Sun, 15 Sep 2024 07:25:33 +0900 Subject: [PATCH] Fix error with empty module table (#328) --- modules/gui/module.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/gui/module.lua b/modules/gui/module.lua index 204f06c4..1414efeb 100644 --- a/modules/gui/module.lua +++ b/modules/gui/module.lua @@ -307,6 +307,9 @@ Event.add(defines.events.on_entity_settings_pasted, function(event) end clear_module(player, destination.bounding_box, destination.name) - apply_module(player, destination.bounding_box, destination.name, {['n']=source_inventory_content, ['p']=source_inventory_content}) + + if next(source_inventory_content) ~= nil then + apply_module(player, destination.bounding_box, destination.name, {['n']=source_inventory_content, ['p']=source_inventory_content}) + end end end)