Quick fix for an issue that needs more looking into

Wed, 03 Dec 2008 18:01:56 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Wed, 03 Dec 2008 18:01:56 +0000
changeset 531
724fd647dc56
parent 530
22ef9bab0834
child 532
c24471cadc2c

Quick fix for an issue that needs more looking into

core/sessionmanager.lua file | annotate | diff | comparison | revisions
--- 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;

mercurial