mod_smacks: Fix error on shutdown if loaded on Component
authorKim Alvefur <zash@zash.se>
Mon, 20 Dec 2021 00:04:32 +0100
changeset 12081 061d516d8ac5
parent 12080 ad1fe36eaae7
child 12082 2c13aaae35ac
mod_smacks: Fix error on shutdown if loaded on Component
plugins/mod_smacks.lua
--- a/plugins/mod_smacks.lua	Sun Dec 19 15:00:22 2021 +0100
+++ b/plugins/mod_smacks.lua	Mon Dec 20 00:04:32 2021 +0100
@@ -630,6 +630,10 @@
 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