Do not try to write user log if network is not found

Fixes #1584
This commit is contained in:
Pavel Djundik 2017-09-29 10:37:27 +03:00
parent da31317156
commit fd21c84a76

View File

@ -136,6 +136,10 @@ Chan.prototype.toJSON = function() {
function writeUserLog(client, msg) {
const target = client.find(this.id);
if (!target) {
return false;
}
userLog.write(
client.name,
target.network.host, // TODO: Fix #1392, multiple connections to same server results in duplicate logs