net: fix error details in connect()
3ac494195319efb9c923c0ee89b6e0f2617d53ef introduced a bug as it attempted to access properties of an undefined variable. This commit cleans up the offending code. Fixes: https://github.com/iojs/io.js/issues/510 PR-URL: https://github.com/iojs/io.js/pull/514 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
parent
4af5746993
commit
e2558f02df
10
lib/net.js
10
lib/net.js
@ -813,13 +813,13 @@ function connect(self, address, port, addressType, localAddress, localPort) {
|
||||
}
|
||||
|
||||
if (err) {
|
||||
self._getsockname();
|
||||
var sockname = self._getsockname();
|
||||
var details;
|
||||
if (self._sockname) {
|
||||
ex.localAddress = self._sockname.address;
|
||||
ex.localPort = self._sockname.port;
|
||||
details = ex.localAddress + ':' + ex.localPort;
|
||||
|
||||
if (sockname) {
|
||||
details = sockname.address + ':' + sockname.port;
|
||||
}
|
||||
|
||||
var ex = exceptionWithHostPort(err, 'connect', address, port, details);
|
||||
self._destroy(ex);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user