From abb6df1c2b4cfbfd936450ba892ad0c9ef688012 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(-) (limited to 'plugins/mod_s2s/mod_s2s.lua') 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