mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 20:16:04 +01:00
fix crash if socket.handshake is null
This commit is contained in:
@@ -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'];
|
||||
|
||||
Reference in New Issue
Block a user