Browse Source

Fix 500 error caused by deleted users on issues (#3675)

for-closed-social
Flare 8 years ago
parent
commit
1b59e6f910
No known key found for this signature in database GPG Key ID: 762EE3D369C1A772
1 changed files with 2 additions and 7 deletions
  1. +2
    -7
      models/issue.go

+ 2
- 7
models/issue.go View File

@ -94,13 +94,8 @@ func (issue *Issue) loadAttributes(e Engine) (err error) {
if issue.Poster == nil { if issue.Poster == nil {
issue.Poster, err = getUserByID(e, issue.PosterID) issue.Poster, err = getUserByID(e, issue.PosterID)
if err != nil { 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…
Cancel
Save