failsafe for empty orgs.array
This commit is contained in:
parent
68d8da7290
commit
e22b143a6a
@ -71,10 +71,18 @@ dofile (topdir .. "/api.lua")
|
|||||||
|
|
||||||
-- ===================================================================
|
-- ===================================================================
|
||||||
-- Final checks
|
-- Final checks
|
||||||
|
|
||||||
|
-- sets org metatable on load
|
||||||
|
if (modpol.orgs.array) then
|
||||||
for id, org in ipairs(modpol.orgs.array) do
|
for id, org in ipairs(modpol.orgs.array) do
|
||||||
if type(org) == 'table' then
|
if type(org) == 'table' then
|
||||||
setmetatable(org, modpol.orgs)
|
setmetatable(org, modpol.orgs)
|
||||||
end
|
end
|
||||||
|
-- sets process metatable on load
|
||||||
|
for id, process in ipairs(org.processes) do
|
||||||
|
setmetatable(process, org.modules[process.type])
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- create instance if not present
|
-- create instance if not present
|
||||||
|
Loading…
x
Reference in New Issue
Block a user