mod_firewall: Prevent traceback if no directed presence has been sent (fixes #1081)
authorKim Alvefur <zash@zash.se>
Fri, 16 Feb 2018 07:54:35 +0100
changeset 2886 6f289283feb1
parent 2885 824b0d7fa883
child 2887 7c16afc70d11
mod_firewall: Prevent traceback if no directed presence has been sent (fixes #1081)
mod_firewall/conditions.lib.lua
--- a/mod_firewall/conditions.lib.lua	Fri Feb 16 04:36:41 2018 +0100
+++ b/mod_firewall/conditions.lib.lua	Fri Feb 16 07:54:35 2018 +0100
@@ -277,7 +277,7 @@
 end
 
 function condition_handlers.SENT_DIRECTED_PRESENCE_TO_SENDER()
-	return "not not session.directed[from]", { "from" };
+	return "not not (session.directed and session.directed[from])", { "from" };
 end
 
 -- TO FULL JID?