Fix crash in public mode introduced by #370
This commit is contained in:
parent
1c6c19fea5
commit
deba6f3aa1
@ -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() {
|
||||
|
@ -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
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user