diff --git a/mods/pipeworks/luaentity.lua b/mods/pipeworks/luaentity.lua index e13c6131..3c4ff63d 100755 --- a/mods/pipeworks/luaentity.lua +++ b/mods/pipeworks/luaentity.lua @@ -29,7 +29,7 @@ local function read_entities() end local function write_entities() - for _, entity in pairs(luaentity.entities) do + for _, entity in pairs(luaentity.entities or {}) do setmetatable(entity, nil) for _, attached in pairs(entity._attached_entities) do if attached.entity then