From 1a089b68ec3044a00a06dcbb3ead98c6d1dd598b Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 20 Dec 2021 00:04:32 +0100 Subject: mod_smacks: Fix error on shutdown if loaded on Component --- plugins/mod_smacks.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'plugins') diff --git a/plugins/mod_smacks.lua b/plugins/mod_smacks.lua index e8a52f99..caccb38a 100644 --- a/plugins/mod_smacks.lua +++ b/plugins/mod_smacks.lua @@ -630,6 +630,10 @@ module:hook("s2s-read-timeout", handle_read_timeout); module:hook("c2s-read-timeout", handle_read_timeout); module:hook_global("server-stopping", function(event) + if not local_sessions then + -- not a VirtualHost, no user sessions + return + end local reason = event.reason; -- Close smacks-enaled sessions ourselves instead of letting mod_c2s close -- it, which invalidates the smacks session. This allows preserving the -- cgit v1.2.3