Software /
code /
prosody-modules
Changeset
2363:12b78170b76c
mod_firewall: INSPECT: Handle stanza:find() returning nil (i.e. path didn't match)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 15 Nov 2016 14:58:16 +0000 (2016-11-15) |
parents | 2362:c065ab67d807 |
children | 2364:17d236129118 |
files | mod_firewall/conditions.lib.lua |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mod_firewall/conditions.lib.lua Tue Nov 15 14:57:40 2016 +0000 +++ b/mod_firewall/conditions.lib.lua Tue Nov 15 14:58:16 2016 +0000 @@ -116,7 +116,7 @@ error("Stanza path does not return a string (append # for text content or @name for value of named attribute)", 0); end if is_pattern_match ~= "" then - return ("stanza:find(%q):match(%q)"):format(path:match("(.-)~=(.*)")); + return ("(stanza:find(%q) or ''):match(%q)"):format(path:match("(.-)~=(.*)")); else return ("stanza:find(%q) == %q"):format(path:match("(.-)=(.*)")); end