mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:42:31 -05:00
net.js: don't pretend that everything is okay when unwrapping fails
In case of an UNWRAP failure, the binding returns -1, which is truthy.
This commit is contained in:
1 parent
29b2fdb0c5
commit
bb675baaa9
1 file changed
+1
-1
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user