Update project.rb

fix error
This commit is contained in:
chiu 2019-08-19 16:51:29 +08:00
parent c480158946
commit 781c88df05
1 changed files with 2 additions and 2 deletions

View File

@ -133,8 +133,8 @@ class Project
files = []
self.project_files.each do |project_file|
url = project_file.file.url
title = (project_file.title.blank? ? File.basename(project_file.file.path) : project_file.title)
files << "<li><a href='#{url}'' target='_blank'>#{title}</li>"
title = ((project_file.title.blank? ? File.basename(project_file.file.path) : project_file.title) rescue "")
files << (url.nil? ? "" : "<li><a href='#{url}'' target='_blank'>#{title}</li>")
end
value = files.join("")
else