Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

net: Allow socket end before connect

Fix a bug where .end on a socket before calling .connect will
throw an error.

Closes #4463
  • Loading branch information...
commit f16094ab8a1c6ce36498b19f4f9c2f68eed1cf83 1 parent 6ecb0cd
@bentaber authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/net.js
View
2  lib/net.js
@@ -191,7 +191,7 @@ function onSocketFinish() {
debug('oSF: not ended, call shutdown()');
// otherwise, just shutdown, or destroy() if not possible
- if (!this._handle.shutdown)
+ if (!this._handle || !this._handle.shutdown)
return this.destroy();
var shutdownReq = this._handle.shutdown();
Please sign in to comment.
Something went wrong with that request. Please try again.