Connection may be `nil`.

This commit is contained in:
Guo Xiang Tan 2017-10-20 12:10:03 +08:00
parent 057571d173
commit d3003592cd
1 changed files with 1 additions and 1 deletions

View File

@ -56,7 +56,7 @@ class PostgreSQLFallbackHandler
connection = ActiveRecord::Base.postgresql_connection(config)
is_connection_active = connection.active?
ensure
connection.disconnect!
connection.disconnect! if connection
end
if is_connection_active