修改version_releases中version_id为空的时候出现的错误

This commit is contained in:
sylor_huang@126.com 2020-05-20 15:22:23 +08:00
parent f197f41839
commit 465594eaaf
1 changed files with 2 additions and 1 deletions

View File

@ -38,8 +38,9 @@ json.releases do
json.image_url user.present? ? url_to_avatar(user) : ""
end
end
json.attachments do
json.array! version.attachments do |attachment|
json.array! version.try(:attachments) do |attachment|
json.partial! "attachments/attachment_simple", locals: {attachment: attachment}
end
end