# HG changeset patch # User Matthew Wild # Date 1228327316 0 # Node ID 724fd647dc566651f69514963b35d68a188e21a9 # Parent 22ef9bab0834163b095717db72992ed071d795d4 Quick fix for an issue that needs more looking into diff -r 22ef9bab0834 -r 724fd647dc56 core/sessionmanager.lua --- a/core/sessionmanager.lua Wed Dec 03 17:24:20 2008 +0000 +++ b/core/sessionmanager.lua Wed Dec 03 18:01:56 2008 +0000 @@ -70,10 +70,12 @@ -- 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;