From b87def729fd0269dbe8d33b4e05cd6ccff3cae9e Mon Sep 17 00:00:00 2001 From: Protected Date: Thu, 15 Dec 2016 17:58:51 +0000 Subject: [PATCH] Check if connection is set before trying to write to it. --- lib/irc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/irc.js b/lib/irc.js index 23ccfe08..c5d9bae8 100644 --- a/lib/irc.js +++ b/lib/irc.js @@ -933,7 +933,7 @@ Client.prototype.send = function(command) { if (this.opt.debug) util.log('SEND: ' + args.join(' ')); - if (!this.conn.requestedDisconnect) { + if (this.conn && !this.conn.requestedDisconnect) { this.conn.write(args.join(' ') + '\r\n'); } };