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;
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() {

View File

@ -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
});
}
}