diff --git a/src/client.js b/src/client.js index bdf6c146..003ad3be 100644 --- a/src/client.js +++ b/src/client.js @@ -67,13 +67,13 @@ function Client(manager, name, config) { var client = this; - if (!client.config.token) { - client.updateToken(function() { - client.manager.updateUser(client.name, {token: client.config.token}); - }); - } - if (config) { + if (!config.token) { + client.updateToken(function() { + client.manager.updateUser(client.name, {token: config.token}); + }); + } + var delay = 0; (config.networks || []).forEach(function(n) { setTimeout(function() { diff --git a/src/server.js b/src/server.js index 036b572e..74b153b8 100644 --- a/src/server.js +++ b/src/server.js @@ -196,7 +196,7 @@ function init(socket, client) { socket.emit("init", { active: client.activeChannel, networks: client.networks, - token: client.config.token + token: client.config ? client.config.token : null }); } }