summaryrefslogtreecommitdiffstats
path: root/models/release.go
diff options
context:
space:
mode:
authorNorwin <noerw@users.noreply.github.com>2021-01-18 13:14:27 +0000
committerGitHub <noreply@github.com>2021-01-18 14:14:27 +0100
commit5ee09d3c8161280c72be8b02cd7ea354c1f55331 (patch)
tree8cbcc0adf26f36837894db1db4342c0f7410289d /models/release.go
parente846b712fc0667c0085cffcc52e4fe9a8fc3ad60 (diff)
downloadgitea-5ee09d3c8161280c72be8b02cd7ea354c1f55331.tar.gz
gitea-5ee09d3c8161280c72be8b02cd7ea354c1f55331.zip
check release publisher exists (#14375)
fixes #14365 was silently fixed in the feature PR #12096 for v1.14
Diffstat (limited to 'models/release.go')
-rw-r--r--models/release.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/models/release.go b/models/release.go
index f55341b86b..1ab36fa57a 100644
--- a/models/release.go
+++ b/models/release.go
@@ -54,7 +54,11 @@ func (r *Release) loadAttributes(e Engine) error {
if r.Publisher == nil {
r.Publisher, err = getUserByID(e, r.PublisherID)
if err != nil {
- return err
+ if IsErrUserNotExist(err) {
+ r.Publisher = NewGhostUser()
+ } else {
+ return err
+ }
}
}
return getReleaseAttachments(e, r)