Changeset

11509:dfdec3f9ccb1 0.11

mod_c2s: Fix traceback in session close when conn is nil Unclear how this happens.
author Kim Alvefur <zash@zash.se>
date Wed, 17 Mar 2021 12:47:16 +0100
parents 11508:f1abc34414bc
children 11510:d241ca8272fe
files plugins/mod_c2s.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_c2s.lua	Thu Mar 18 14:30:47 2021 +0100
+++ b/plugins/mod_c2s.lua	Wed Mar 17 12:47:16 2021 +0100
@@ -190,12 +190,12 @@
 				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;