diff options
author | Flare <flare@lefs.me> | 2016-09-20 17:54:47 +0800 |
---|---|---|
committer | Flare <flare@lefs.me> | 2016-09-20 18:13:57 +0800 |
commit | 1b59e6f91011cdeccf146a20f758677143710885 (patch) | |
tree | aff17b3cc11389334ab243f8c76959717856a04f | |
parent | 7e15ff9486cde36b76f3d39b7db23f89278acb7d (diff) | |
download | gitea-1b59e6f91011cdeccf146a20f758677143710885.tar.gz gitea-1b59e6f91011cdeccf146a20f758677143710885.zip |
Fix 500 error caused by deleted users on issues (#3675)
-rw-r--r-- | models/issue.go | 9 |
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() } } |