forked from mirror/gitea
Merge pull request #18 from LefsFlarey/issue/3675
Fix 500 error caused by deleted users on issues (#3675)
This commit is contained in:
commit
c511f1c6c3
@ -94,12 +94,12 @@ 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 {
|
||||
issue.PosterID = -1
|
||||
issue.Poster = NewGhostUser()
|
||||
if !IsErrUserNotExist(err) {
|
||||
return fmt.Errorf("getUserByID.(poster) [%d]: %v", issue.PosterID, err)
|
||||
}
|
||||
err = nil
|
||||
return
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user