summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlare <flare@lefs.me>2016-09-20 17:54:47 +0800
committerFlare <flare@lefs.me>2016-09-20 18:13:57 +0800
commit1b59e6f91011cdeccf146a20f758677143710885 (patch)
treeaff17b3cc11389334ab243f8c76959717856a04f
parent7e15ff9486cde36b76f3d39b7db23f89278acb7d (diff)
downloadgitea-1b59e6f91011cdeccf146a20f758677143710885.tar.gz
gitea-1b59e6f91011cdeccf146a20f758677143710885.zip
Fix 500 error caused by deleted users on issues (#3675)
-rw-r--r--models/issue.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/models/issue.go b/models/issue.go
index 208204b076..3c1e27d737 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -94,13 +94,8 @@ func (issue *Issue) loadAttributes(e Engine) (err error) {
if issue.Poster == nil {
issue.Poster, err = getUserByID(e, issue.PosterID)
if err != nil {
- if IsErrUserNotExist(err) {
- issue.PosterID = -1
- issue.Poster = NewGhostUser()
- } else {
- return fmt.Errorf("getUserByID.(poster) [%d]: %v", issue.PosterID, err)
- }
- return
+ issue.PosterID = -1
+ issue.Poster = NewGhostUser()
}
}