Ensure params[:files] responds to map in Lograge.

This commit is contained in:
Guo Xiang Tan 2018-09-04 09:22:54 +08:00
parent fcae21c4fc
commit 0a14e0a256

View File

@ -53,7 +53,7 @@ if (Rails.env.production? && SiteSetting.logging_provider == 'lograge') || ENV["
params[:file] = file.headers
end
if (files = params[:files])
if (files = params[:files]) && files.respond_to?(:map)
params[:files] = files.map do |file|
file.respond_to?(:headers) ? file.headers : file
end