diff --git a/app/models/version_release.rb b/app/models/version_release.rb index 3c97420ea..00119f806 100644 --- a/app/models/version_release.rb +++ b/app/models/version_release.rb @@ -32,7 +32,8 @@ class VersionRelease < ApplicationRecord has_many :attachments, as: :container, dependent: :destroy def update_sha + return if version_gid.blank? git_release = Gitea::Versions::GetService.call(user.gitea_token, repository&.owner&.login, repository&.identifier, version_gid) - self.update(sha: git_release["sha"]) + self.update(sha: git_release["sha"]) if git_release.present? && git_release.is_a?(Hash) end end