Browse Source

Improvement on error catching in process

Nathan Schneider 1 year ago
parent
commit
b09a7a24b4
1 changed files with 5 additions and 4 deletions
  1. 5 4
      modpol_core/orgs/process.lua

+ 5 - 4
modpol_core/orgs/process.lua

@@ -11,12 +11,13 @@ function modpol.orgs:call_module(module_slug, initiator, config, result, parent_
    
    -- first, if no slug, just run result
    -- may not be necessary if we use false as default approval_module
-   if not module_slug
-      and result() then
-      result()
+   if not module_slug then
+      if result() then
+         result()
+      end
       return
+   -- if module doesn't exist, abort    
    elseif not modpol.modules[module_slug] then
-   -- if module doesn't exist, abort
       modpol.ocutil.log('Error in ' .. self.name .. ':call_module -> module "' .. tostring(module_slug) .. '" not found')
       return
    end