From b5f808c769e384bed666e92a221516f424f55fae Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 17 Mar 2021 12:47:16 +0100 Subject: mod_c2s: Fix traceback in session close when conn is nil Unclear how this happens. --- plugins/mod_c2s.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/mod_c2s.lua b/plugins/mod_c2s.lua index f8675258..f3259ed2 100644 --- a/plugins/mod_c2s.lua +++ b/plugins/mod_c2s.lua @@ -190,12 +190,12 @@ local function session_close(session, reason) if not session.destroyed then session.log("warn", "Failed to receive a stream close response, closing connection anyway..."); sm_destroy_session(session, reason_text); - conn:close(); + if conn then conn:close(); end end end); else sm_destroy_session(session, reason_text); - conn:close(); + if conn then conn:close(); end end else local reason_text = (reason and (reason.name or reason.text or reason.condition)) or reason; -- cgit v1.2.3