Various bugfixes on defer and processes

This commit is contained in:
Nathan Schneider
2022-08-17 17:24:53 -06:00
parent df20cc835b
commit 838a017f14
4 changed files with 11 additions and 6 deletions

View File

@ -8,13 +8,18 @@
-- @param config Config for module
-- @param result
function modpol.orgs:call_module(module_slug, initiator, config, result, parent_id)
if not module_slug then -- if slug is false then simply run result
-- 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()
return
end
-- if module doesn't exist, abort
if not modpol.modules[module_slug] then
modpol.ocutil.log('Error in ' .. self.name .. ':call_module -> module "' .. module_slug .. '" not found')
modpol.ocutil.log('Error in ' .. self.name .. ':call_module -> module "' .. tostring(module_slug) .. '" not found')
return
end