aboutsummaryrefslogtreecommitdiffstats
path: root/core/sessionmanager.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2008-10-24 07:34:13 +0100
committerMatthew Wild <mwild1@gmail.com>2008-10-24 07:34:13 +0100
commitd49ea8a12e4440a0df267b575e4925231bda4803 (patch)
tree490259090b642a38634973be5ed4d8d42ec500d1 /core/sessionmanager.lua
parent1d1e9fba5745958c092d28563970f1acb4ee4604 (diff)
downloadprosody-d49ea8a12e4440a0df267b575e4925231bda4803.tar.gz
prosody-d49ea8a12e4440a0df267b575e4925231bda4803.zip
Partial s2s commit
Diffstat (limited to 'core/sessionmanager.lua')
-rw-r--r--core/sessionmanager.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/core/sessionmanager.lua b/core/sessionmanager.lua
index d140ebe0..fd9b1272 100644
--- a/core/sessionmanager.lua
+++ b/core/sessionmanager.lua
@@ -35,14 +35,15 @@ end
function destroy_session(session)
session.log("info", "Destroying session");
- if session.username then
+ if session.host and session.username then
if session.resource then
hosts[session.host].sessions[session.username].sessions[session.resource] = nil;
end
-
- if not next(hosts[session.host].sessions[session.username].sessions) then
- log("debug", "All resources of %s are now offline", session.username);
- hosts[session.host].sessions[session.username] = nil;
+ if hosts[session.host] and hosts[session.host].sessions[session.username] then
+ if not next(hosts[session.host].sessions[session.username].sessions) then
+ log("debug", "All resources of %s are now offline", session.username);
+ hosts[session.host].sessions[session.username] = nil;
+ end
end
end
session.conn = nil;