summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-05-06 20:09:31 +0800
committerGitHub <noreply@github.com>2019-05-06 20:09:31 +0800
commit2382f1b057bb582abc87a030f0463e3b1f6fb118 (patch)
treea9876ef817bf72ddeafbb0a5721aaa49f0f7650d /routers
parentdab38c375df5c4719d35f1be29278d254d68390f (diff)
downloadgitea-2382f1b057bb582abc87a030f0463e3b1f6fb118.tar.gz
gitea-2382f1b057bb582abc87a030f0463e3b1f6fb118.zip
fix 500 when reviewer is deleted with integration tests (#6856)
Diffstat (limited to 'routers')
-rw-r--r--routers/repo/issue.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go
index 4b76bf5ad9..c2749fcb47 100644
--- a/routers/repo/issue.go
+++ b/routers/repo/issue.go
@@ -773,6 +773,8 @@ func ViewIssue(ctx *context.Context) {
// Render comments and and fetch participants.
participants[0] = issue.Poster
for _, comment = range issue.Comments {
+ comment.Issue = issue
+
if err := comment.LoadPoster(); err != nil {
ctx.ServerError("LoadPoster", err)
return
@@ -850,8 +852,11 @@ func ViewIssue(ctx *context.Context) {
continue
}
if err = comment.Review.LoadAttributes(); err != nil {
- ctx.ServerError("Review.LoadAttributes", err)
- return
+ if !models.IsErrUserNotExist(err) {
+ ctx.ServerError("Review.LoadAttributes", err)
+ return
+ }
+ comment.Review.Reviewer = models.NewGhostUser()
}
if err = comment.Review.LoadCodeComments(); err != nil {
ctx.ServerError("Review.LoadCodeComments", err)