S3 migrations from/to minio problems

I tried to test migrate to s3 for another time to test if this commit which was done by @rishabh, fixes some of the problems above, However, I got the following error

rake uploads:migrate_to_s3
rake aborted!
NoMethodError: undefined method `include?' for nil:NilClass
/var/www/discourse/lib/tasks/uploads.rake:217:in `migrate_to_s3'
/var/www/discourse/lib/tasks/uploads.rake:210:in `block in migrate_to_s3_all_sites'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rails_multisite-2.0.4/lib/rails_multisite/connection_management.rb:63:in `with_connection'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rails_multisite-2.0.4/lib/rails_multisite/connection_management.rb:73:in `each_connection'
/var/www/discourse/lib/tasks/uploads.rake:210:in `migrate_to_s3_all_sites'
/var/www/discourse/lib/tasks/uploads.rake:206:in `block in <top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
Tasks: TOP => uploads:migrate_to_s3
(See full trace by running task with --trace)

https://github.com/discourse/discourse/blob/f181e9cc08a5d3c31598587957f8999b7e62ac50/lib/tasks/uploads.rake#L217