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;
|
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() {
|
||||||
|
@ -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
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user