Skip to content

Commit

Permalink
Fix crash in public mode introduced by thelounge#370 (thelounge#413)
Browse files Browse the repository at this point in the history
  • Loading branch information
xPaw authored Jun 19, 2016
2 parents 6458427 + 18ba169 commit f17f4e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
}
}
Expand Down

0 comments on commit f17f4e9

Please sign in to comment.