Commit a4df0ab6 authored by Kaarle Ritvanen's avatar Kaarle Ritvanen

allow returning nil from module event functions

parent 06774cfa
......@@ -122,8 +122,10 @@ function Config:init(policyconfig)
local r = events[event].rules
if r then
if type(r) == 'function' then r = r(self.objects) end
assert(type(r) == 'table')
insertrules(r)
if r then
assert(type(r) == 'table')
insertrules(r)
end
end
elseif self.objects[event] then
for i, rule in ipairs(self.objects[event]) do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment