diff --git a/lib/mongo/connection.rb b/lib/mongo/connection.rb index 253a1ae..e7df7c2 100644 --- a/lib/mongo/connection.rb +++ b/lib/mongo/connection.rb @@ -604,7 +604,9 @@ module Mongo @nodes_tried << node if config update_node_list(config['hosts']) if config['hosts'] - @logger.warn(config['msg']) if config['msg'] + if @logger + @logger.warn(config['msg']) if config['msg'] + end end socket.close if socket