diff --git a/lib/net.js b/lib/net.js index 3acaf8a130b..4ebc940c3c3 100644 --- a/lib/net.js +++ b/lib/net.js @@ -512,7 +512,7 @@ Socket.prototype._write = function(data, encoding, cb) { // `encoding` is unused right now, `data` is always a buffer. var writeReq = this._handle.write(data); - if (!writeReq) { + if (!writeReq || typeof writeReq !== 'object') { this._destroy(errnoException(errno, 'write'), cb); return false; }