From e652ead78f09d09c5f97437ffc28bcdbc95cc07d Mon Sep 17 00:00:00 2001 From: albertyfwu Date: Sat, 16 Mar 2013 18:31:58 -0400 Subject: [PATCH] feature-check for bufferedAmount --- lib/transports/websocket.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/transports/websocket.js b/lib/transports/websocket.js index 338013c3..36a60366 100644 --- a/lib/transports/websocket.js +++ b/lib/transports/websocket.js @@ -89,7 +89,7 @@ WS.prototype.write = function(packets){ this.socket.send(parser.encodePayload(packets)); // check periodically if we're done sending this.bufferedAmountId = this.setInterval(function() { - if (socket.bufferedAmount == 0) { + if ('bufferedAmount' in this.socket && this.socket.bufferedAmount == 0) { clearInterval(self.bufferedAmountId); this.writable = true; this.emit('drain');