Update patent.rb

fix error
This commit is contained in:
chiu 2019-08-19 16:52:22 +08:00
parent 00103841c3
commit dc1e3a6d0a
1 changed files with 2 additions and 2 deletions

View File

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