From 5f11c262236078a8d671b5fbdb515de02a0671e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Astori?= Date: Mon, 29 Feb 2016 01:19:11 +0000 Subject: [PATCH] Fix complete crash when refreshing a public instance --- src/server.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/server.js b/src/server.js index 1951bbd6..dbc44dba 100644 --- a/src/server.js +++ b/src/server.js @@ -8,7 +8,6 @@ var io = require("socket.io"); var Helper = require("./helper"); var config = {}; -var sockets = null; var manager = new ClientManager(); module.exports = function(options) { @@ -43,7 +42,7 @@ module.exports = function(options) { require("./identd").start(config.identd.port); } - sockets = io(server, { + var sockets = io(server, { transports: transports }); @@ -182,7 +181,7 @@ function init(socket, client, token) { function auth(data) { var socket = this; if (config.public) { - var client = new Client(sockets); + var client = new Client(manager); manager.clients.push(client); socket.on("disconnect", function() { manager.clients = _.without(manager.clients, client);