Mercurial > prosody-modules
diff mod_firewall/conditions.lib.lua @ 2582:ac3140cd89a2
mod_firewall: Fix compilation error if TYPE/KIND had no parameter
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 25 Feb 2017 18:38:26 +0000 |
parents | 00cef058df8d |
children | d64fc9c3cffd |
line wrap: on
line diff
--- a/mod_firewall/conditions.lib.lua Sat Feb 25 18:36:21 2017 +0000 +++ b/mod_firewall/conditions.lib.lua Sat Feb 25 18:38:26 2017 +0000 @@ -21,6 +21,7 @@ end function condition_handlers.KIND(kind) + assert(kind, "Expected stanza kind to match against"); return compile_comparison_list("name", kind), { "name" }; end @@ -81,6 +82,7 @@ end function condition_handlers.TYPE(type) + assert(type, "Expected 'type' value to match against"); return compile_comparison_list("(type or (name == 'message' and 'normal') or (name == 'presence' and 'available'))", type), { "type", "name" }; end