mod_c2s: Fix error on role change on Components (thanks Menel)
authorKim Alvefur <zash@zash.se>
Sat, 17 Feb 2024 19:07:57 +0100
changeset 13424 7dc7e2e15b2a
parent 13423 41a587613a0e
child 13425 92301fa7a673
mod_c2s: Fix error on role change on Components (thanks Menel)
plugins/mod_c2s.lua
--- a/plugins/mod_c2s.lua	Fri Feb 16 00:15:36 2024 +0100
+++ b/plugins/mod_c2s.lua	Sat Feb 17 19:07:57 2024 +0100
@@ -252,6 +252,9 @@
 local function disconnect_user_sessions(reason, leave_resource)
 	return function (event)
 		local username, host, resource = event.username, event.host, event.resource;
+		if not (hosts[host] and hosts[host].type == "local") then
+			return -- not a local VirtualHost so no sessions
+		end
 		local user = hosts[host].sessions[username];
 		if user and user.sessions then
 			for r, session in pairs(user.sessions) do