aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/mod_c2s.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/mod_c2s.lua b/plugins/mod_c2s.lua
index fc838c0d..a222f939 100644
--- a/plugins/mod_c2s.lua
+++ b/plugins/mod_c2s.lua
@@ -92,6 +92,9 @@ function stream_callbacks._streamopened(session, attr)
session:open_stream(host, attr.from);
+ -- Opening the stream can cause the stream to be closed
+ if session.destroyed then return end
+
(session.log or log)("debug", "Sent reply <stream:stream> to client");
session.notopen = nil;