diff options
author | Kim Alvefur <zash@zash.se> | 2021-03-17 12:47:16 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2021-03-17 12:47:16 +0100 |
commit | b5f808c769e384bed666e92a221516f424f55fae (patch) | |
tree | 52ba2aead7d02a0b4d0c8fce1e131f711e259588 | |
parent | a7cc31c6bb735536d07b5578fbd3ed3ac3ba01ec (diff) | |
download | prosody-b5f808c769e384bed666e92a221516f424f55fae.tar.gz prosody-b5f808c769e384bed666e92a221516f424f55fae.zip |
mod_c2s: Fix traceback in session close when conn is nil
Unclear how this happens.
-rw-r--r-- | plugins/mod_c2s.lua | 4 |
1 files 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; |