Fix error with empty module table (#328)

This commit is contained in:
phidias authored and GitHub committed 2024-09-14 23:25:33 +01:00
1 parent 90faf2ff93
commit 659a8acb0d
1 file changed
+4 -1
+4 -1
View File
@@ -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)