fix crash if socket.handshake is null

v1.18.x
psychobunny 10 years ago
parent 3d5e72bbc8
commit 25c7dfbc12

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

Loading…
Cancel
Save