From 5c1503b596d6d52f191ae400273e71b77bed7109 Mon Sep 17 00:00:00 2001 From: deuce <> Date: Sat, 4 Jun 2011 00:35:15 +0000 Subject: [PATCH] Do not write null lines (end of message) to channel. --- exec/ircbots/admin/admin_commands.js | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/exec/ircbots/admin/admin_commands.js b/exec/ircbots/admin/admin_commands.js index 9662b1a19f..c0f62b725b 100644 --- a/exec/ircbots/admin/admin_commands.js +++ b/exec/ircbots/admin/admin_commands.js @@ -418,15 +418,19 @@ Bot_Commands["FINGER"].command = function (target,onick,ouh,srv,lvl,cmd) { return; } } else { - srv.o(target, strip_ctrl(f_sock.readline())); - f_line_count++; - if ((f_line_count > 10) && - (lvl < 75) && - ((target[0] == "#") || - (target[0] == "&")) ) { - srv.o(target,"*** Connection Terminated " - +"(output squelched after 10 lines)"); - return; + var line=f_sock.readline(); + + if(line != null) { + srv.o(target, strip_ctrl(line)); + f_line_count++; + if ((f_line_count > 10) && + (lvl < 75) && + ((target[0] == "#") || + (target[0] == "&")) ) { + srv.o(target,"*** Connection Terminated " + +"(output squelched after 10 lines)"); + return; + } } } if (time() >= timeout) { -- GitLab