aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2008-12-03 18:01:56 +0000
committerMatthew Wild <mwild1@gmail.com>2008-12-03 18:01:56 +0000
commit396d493b18d04e81c5d5a7d67fc9ef7c16be9558 (patch)
tree8b1b64ed8ae3c56c858a795c6f8eaa182502b1be /core
parent96a4cbc2a717b062cc3ee488094345910ca6e6ea (diff)
downloadprosody-396d493b18d04e81c5d5a7d67fc9ef7c16be9558.tar.gz
prosody-396d493b18d04e81c5d5a7d67fc9ef7c16be9558.zip
Quick fix for an issue that needs more looking into
Diffstat (limited to 'core')
-rw-r--r--core/sessionmanager.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/sessionmanager.lua b/core/sessionmanager.lua
index d17a0357..98c41962 100644
--- a/core/sessionmanager.lua
+++ b/core/sessionmanager.lua
@@ -70,10 +70,12 @@ function destroy_session(session, err)
-- Remove session/resource from user's session list
if session.host and session.username then
- if session.resource then
- hosts[session.host].sessions[session.username].sessions[session.resource] = nil;
- end
+ -- FIXME: How can the below ever be nil? (but they sometimes are...)
if hosts[session.host] and hosts[session.host].sessions[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;