# HG changeset patch # User Matthew Wild # Date 1365185921 -3600 # Node ID c7fca2c9e24f24d37f9f44929c5f30875b206d95 # Parent 93ffa3ffc66f3011a4d668729fdd68ee8ddcd834 mod_firewall/conditions: Don't use table.insert, so things are happy when compile_jid_match() returns nil diff -r 93ffa3ffc66f -r c7fca2c9e24f mod_firewall/conditions.lib.lua --- a/mod_firewall/conditions.lib.lua Fri Apr 05 19:17:33 2013 +0100 +++ b/mod_firewall/conditions.lib.lua Fri Apr 05 19:18:41 2013 +0100 @@ -41,11 +41,12 @@ local function compile_jid_match(which, match_jid) local match_node, match_host, match_resource = jid.split(match_jid); - local conditions = { - compile_jid_match_part(which.."_node", match_node); - compile_jid_match_part(which.."_host", match_host); - match_resource and compile_jid_match_part(which.."_resource", match_resource) or nil; - }; + local conditions = {}; + conditions[#conditions+1] = compile_jid_match_part(which.."_node", match_node); + conditions[#conditions+1] = compile_jid_match_part(which.."_host", match_host); + if match_resource then + conditions[#conditions+1] = compile_jid_match_part(which.."_resource", match_resource); + end return table.concat(conditions, " and "); end