mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-28 22:53:54 +03:00
Fix 500 error caused by deleted users on issues (#3675)
This commit is contained in:
parent
7e15ff9486
commit
1b59e6f910
1 changed files with 2 additions and 7 deletions
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue