Check if eol is not a string rather than not undefined or not null in websocket.sendS...
authorJack Allnutt <m2ys4u@Gmail.com>
Fri, 18 Nov 2011 13:14:46 +0000 (13:14 +0000)
committerJack Allnutt <m2ys4u@Gmail.com>
Fri, 18 Nov 2011 13:14:46 +0000 (13:14 +0000)
server/app.js

index 2837edb47b1f8a448bdeb645117c2b0d0ead10ab..ba5f802ea85987b7007479ea11b4423e095d64a0 100644 (file)
@@ -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);