aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-03-17 12:47:16 +0100
committerKim Alvefur <zash@zash.se>2021-03-17 12:47:16 +0100
commitb5f808c769e384bed666e92a221516f424f55fae (patch)
tree52ba2aead7d02a0b4d0c8fce1e131f711e259588
parenta7cc31c6bb735536d07b5578fbd3ed3ac3ba01ec (diff)
downloadprosody-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.lua4
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;