RUBY-377 ensure that @manager is never nil

This commit is contained in:
Kyle Banker 2011-12-01 12:01:13 -05:00
parent 74e6a60c25
commit d3c9637268
1 changed files with 2 additions and 1 deletions

View File

@ -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