From: Jack Allnutt Date: Fri, 18 Nov 2011 13:14:46 +0000 (+0000) Subject: Check if eol is not a string rather than not undefined or not null in websocket.sendS... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=fc92c3d7c233b13efaaac34122851811f86f32db;p=KiwiIRC.git Check if eol is not a string rather than not undefined or not null in websocket.sendServerLine() --- diff --git a/server/app.js b/server/app.js index 2837edb..ba5f802 100644 --- a/server/app.js +++ b/server/app.js @@ -871,9 +871,8 @@ this.websocketConnection = function (websocket) { websocket.sendServerLine = function (data, eol, callback) { if ((arguments.length < 3) && (typeof eol === 'function')) { callback = eol; - eol = '\r\n'; } - eol = ((typeof eol === 'undefined') || (eol === null)) ? '\r\n' : eol; + eol = (typeof eol !== 'string') ? '\r\n' : eol; try { websocket.ircConnection.write(data + eol, 'utf-8', callback);