sessionmanager: Fixed a traceback on invalid usernames (typo in previous commit). 0.7.0

Fri, 11 Jun 2010 21:30:24 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Fri, 11 Jun 2010 21:30:24 +0500
changeset 3239
5ea90ee96022
parent 3238
362b94fa5a30
child 3240
9782a222e941
child 3241
fee11dbd5cf8

sessionmanager: Fixed a traceback on invalid usernames (typo in previous commit).

core/sessionmanager.lua file | annotate | diff | comparison | revisions
--- a/core/sessionmanager.lua	Fri Jun 11 21:01:17 2010 +0500
+++ b/core/sessionmanager.lua	Fri Jun 11 21:30:24 2010 +0500
@@ -111,7 +111,7 @@
 
 function make_authenticated(session, username)
 	username = nodeprep(username);
-	if not username and #username > 0 then return nil, "Invalid username"; end
+	if not username or #username == 0 then return nil, "Invalid username"; end
 	session.username = username;
 	if session.type == "c2s_unauthed" then
 		session.type = "c2s";

mercurial