Skip to content

Commit d602201

Browse files
committed
add null check
1 parent 2d44ef8 commit d602201

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/servers/SockJSServer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ module.exports = class SockJSServer extends BaseServer {
6464
// f should be passed the resulting connection and the connection headers
6565
onConnection(f) {
6666
this.socket.on('connection', (connection) => {
67-
f(connection, connection.headers);
67+
f(connection, connection ? connection.headers : null);
6868
});
6969
}
7070

0 commit comments

Comments
 (0)