rescue for nil files

This commit is contained in:
Harry Bomrah 2014-10-17 14:24:15 +08:00
parent d8375c2e23
commit e4e3d66f32
1 changed files with 1 additions and 1 deletions

View File

@ -38,7 +38,7 @@ class UpgradeController < ApplicationController
} }
end end
files = b.bulletin_files.collect do |bf| files = b.bulletin_files.collect do |bf|
file = request.protocol + request.host_with_port + bf.file.url if !bf.file.nil? file = request.protocol + request.host_with_port + bf.file.url rescue nil
{ {
"title" => bf.title_translations, "title" => bf.title_translations,
"description" => bf.description_translations, "description" => bf.description_translations,