From d3c9637268e322ecfc18483a4adce345b8ab9d51 Mon Sep 17 00:00:00 2001 From: Kyle Banker Date: Thu, 1 Dec 2011 12:01:13 -0500 Subject: [PATCH] RUBY-377 ensure that @manager is never nil --- lib/mongo/repl_set_connection.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/mongo/repl_set_connection.rb b/lib/mongo/repl_set_connection.rb index 514f5ea..79264b7 100644 --- a/lib/mongo/repl_set_connection.rb +++ b/lib/mongo/repl_set_connection.rb @@ -153,6 +153,7 @@ module Mongo log(:info, "Connecting...") return if @connected manager = PoolManager.new(self, @seeds) + @manager = manager manager.connect update_config(manager) @@ -341,7 +342,7 @@ module Mongo # Checkin a socket used for writing. def checkin_writer(socket) - if !self.primary_pool.checkin(socket) + if !self.primary_pool || !self.primary_pool.checkin(socket) close_socket(socket) end sync_refresh