--- 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;