Skip to content

Commit

Permalink
Fixed bug in pull request
Browse files Browse the repository at this point in the history
  • Loading branch information
christkv committed Sep 10, 2012
1 parent f75f560 commit 3b4acf3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/mongodb/connection/repl_set.js
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,10 @@ var _connectHandler = function(self, candidateServers, instanceServer) {
// Make sure we have the right reference
if (self._state.addresses[instanceServer.host + ":" + instanceServer.port] != instanceServer) {
// Close the connection before deleting
self._state.addresses[instanceServer.host + ":" + instanceServer.port].close();
if(self._state.addresses[instanceServer.host + ":" + instanceServer.port])
self._state.addresses[instanceServer.host + ":" + instanceServer.port].close();
}

delete self._state.addresses[instanceServer.host + ":" + instanceServer.port];
self._state.addresses[me] = instanceServer;

Expand Down

0 comments on commit 3b4acf3

Please sign in to comment.