Fix crash in public mode introduced by #370

This commit is contained in:
Maxime Poulin 2016-06-18 21:01:38 -04:00
parent 1c6c19fea5
commit deba6f3aa1
No known key found for this signature in database
GPG Key ID: CB63C36252F40D4B
2 changed files with 7 additions and 7 deletions

View File

@ -67,13 +67,13 @@ function Client(manager, name, config) {
var client = this; var client = this;
if (!client.config.token) { if (config) {
if (!config.token) {
client.updateToken(function() { client.updateToken(function() {
client.manager.updateUser(client.name, {token: client.config.token}); client.manager.updateUser(client.name, {token: config.token});
}); });
} }
if (config) {
var delay = 0; var delay = 0;
(config.networks || []).forEach(function(n) { (config.networks || []).forEach(function(n) {
setTimeout(function() { setTimeout(function() {

View File

@ -196,7 +196,7 @@ function init(socket, client) {
socket.emit("init", { socket.emit("init", {
active: client.activeChannel, active: client.activeChannel,
networks: client.networks, networks: client.networks,
token: client.config.token token: client.config ? client.config.token : null
}); });
} }
} }