Browse Source

Fixed table error on processes load

Nathan Schneider 3 years ago
parent
commit
592226fe5a
1 changed files with 5 additions and 3 deletions
  1. 5 3
      modpol/modpol.lua

+ 5 - 3
modpol/modpol.lua

@@ -78,8 +78,10 @@ if (modpol.orgs.array) then
         if type(org) == 'table' then 
             setmetatable(org, modpol.orgs)
             -- sets process metatable on load
-            for id, process in ipairs(org.processes) do
-                setmetatable(process, modpol.modules[process.type])
+            if type(org.processes) == 'table' then
+               for id, process in ipairs(org.processes) do
+                  setmetatable(process, modpol.modules[process.type])
+               end
             end
         end
     end
@@ -92,4 +94,4 @@ modpol.instance = modpol.orgs.array[1] or modpol.orgs.init_instance()
 modpol.ocutil.log ("modpol loaded")
 
 -- ===================================================================
--- End of file.
+-- End of file.