During a refresh Thread.current[:managers] has the potential to be nil.

This fix checks to make sure Thread.current[:managers] exists before
trying to access the managers hash.
This commit is contained in:
Tyler Brock 2012-06-01 14:08:26 -04:00
parent f55fc95bf4
commit 291a9334b6
1 changed files with 2 additions and 2 deletions

View File

@ -402,7 +402,7 @@ module Mongo
end
def get_socket_from_pool(pool_type)
if Thread.current[:managers][self] != @manager
if Thread.current[:managers] && Thread.current[:managers][self] != @manager
Thread.current[:managers][self] = @manager
end
@ -426,7 +426,7 @@ module Mongo
end
def local_manager
Thread.current[:managers][self]
Thread.current[:managers][self] if Thread.current[:managers]
end
def arbiters