aboutsummaryrefslogtreecommitdiffstats
path: root/routers/repo/release.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/repo/release.go')
-rw-r--r--routers/repo/release.go16
1 files changed, 12 insertions, 4 deletions
diff --git a/routers/repo/release.go b/routers/repo/release.go
index 880385708f..8baa317e0c 100644
--- a/routers/repo/release.go
+++ b/routers/repo/release.go
@@ -45,8 +45,12 @@ func Releases(ctx *middleware.Context) {
if rel.TagName == rawTag {
rel.Publisher, err = models.GetUserByID(rel.PublisherID)
if err != nil {
- ctx.Handle(500, "GetUserByID", err)
- return
+ if models.IsErrUserNotExist(err) {
+ rel.Publisher = models.NewFakeUser()
+ } else {
+ ctx.Handle(500, "GetUserByID", err)
+ return
+ }
}
// FIXME: duplicated code.
// Get corresponding target if it's not the current branch.
@@ -105,8 +109,12 @@ func Releases(ctx *middleware.Context) {
rel.Publisher, err = models.GetUserByID(rel.PublisherID)
if err != nil {
- ctx.Handle(500, "GetUserByID", err)
- return
+ if models.IsErrUserNotExist(err) {
+ rel.Publisher = models.NewFakeUser()
+ } else {
+ ctx.Handle(500, "GetUserByID", err)
+ return
+ }
}
// FIXME: duplicated code.
// Get corresponding target if it's not the current branch.