Diff

core/sessionmanager.lua @ 531:724fd647dc56

Quick fix for an issue that needs more looking into
author Matthew Wild <mwild1@gmail.com>
date Wed, 03 Dec 2008 18:01:56 +0000
parent 519:cccd610a0ef9
child 532:c24471cadc2c
line wrap: on
line diff
--- 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;