From 6cff8fa4749a367ac6dd4581a1e5bcfc4c8e3881 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 7 Aug 2016 20:48:37 +0200 Subject: mod_s2s: Index session after checking if it exists (fixes traceback in case of a connection without a session having a read timeout) --- plugins/mod_s2s/mod_s2s.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua index ea186cf0..ae9a746a 100644 --- a/plugins/mod_s2s/mod_s2s.lua +++ b/plugins/mod_s2s/mod_s2s.lua @@ -642,8 +642,8 @@ end function listener.onreadtimeout(conn) local session = sessions[conn]; - local host = session.host or session.to_host; if session then + local host = session.host or session.to_host; return (hosts[host] or prosody).events.fire_event("s2s-read-timeout", { session = session }); end end -- cgit v1.2.3