From fd21c84a76393927cfad072c7bdceb73c996bb65 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Fri, 29 Sep 2017 10:37:27 +0300 Subject: [PATCH] Do not try to write user log if network is not found Fixes #1584 --- src/models/chan.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/models/chan.js b/src/models/chan.js index 2b727204..efb28738 100644 --- a/src/models/chan.js +++ b/src/models/chan.js @@ -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