fix crash if socket.handshake is null

This commit is contained in:
psychobunny
2014-10-27 20:23:16 -04:00
parent 3d5e72bbc8
commit 25c7dfbc12

View File

@@ -115,10 +115,14 @@ Sockets.init = function(server) {
var hs = socket.handshake,
sessionID, uid;
if (!hs) {
return;
}
// Validate the session, if present
socketCookieParser(hs, {}, function(err) {
if(err) {
winston.error(err.message);
return winston.error(err.message);
}
sessionID = socket.handshake.signedCookies['express.sid'];