aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_smacks.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2024-11-19 00:53:01 +0100
committerKim Alvefur <zash@zash.se>2024-11-19 00:53:01 +0100
commitfff5a91e376d1cd7eddb7be6d18920fa2efaaa4d (patch)
treef22cd837c00f17bccff08299394db9cd66cbff23 /plugins/mod_smacks.lua
parent61b0c0cd3ad805281ea5021278ecd6372296c9c5 (diff)
downloadprosody-fff5a91e376d1cd7eddb7be6d18920fa2efaaa4d.tar.gz
prosody-fff5a91e376d1cd7eddb7be6d18920fa2efaaa4d.zip
mod_smacks: Prevent traceback on attempting to resume destroyed session
This shouldn't be possible, but seems to happen anyway after net.server somehow calling the close handler twice, which also should not happen.
Diffstat (limited to 'plugins/mod_smacks.lua')
-rw-r--r--plugins/mod_smacks.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/mod_smacks.lua b/plugins/mod_smacks.lua
index 7a9a67b3..62cf9dd1 100644
--- a/plugins/mod_smacks.lua
+++ b/plugins/mod_smacks.lua
@@ -587,6 +587,11 @@ function do_resume(session, stanza)
local id = stanza.attr.previd;
local original_session = session_registry[registry_key(session, id)];
+ if original_session.destroyed then
+ original_session.log("error", "Tried to resume a destroyed session. This should not happen! %s", debug.traceback());
+ session_registry[registry_key(session, id)] = nil;
+ original_session = nil;
+ end
if not original_session then
local old_session = old_session_registry:get(session.username, id);
if old_session then