diff options
author | Ethan Koenig <etk39@cornell.edu> | 2017-06-08 21:51:31 -0400 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-06-09 09:51:31 +0800 |
commit | 73836ce8c465588f40b3d43d49a784d679966822 (patch) | |
tree | 5fde0acfb9c107c735940693cd1d6612ab1a9464 /models/issue_list.go | |
parent | b1b8c5e9f4552b6bf6f34ce83518c3269e4eacfe (diff) | |
download | gitea-73836ce8c465588f40b3d43d49a784d679966822.tar.gz gitea-73836ce8c465588f40b3d43d49a784d679966822.zip |
Fix ghost user bug (#1913)
Fix bug where unassigned issues would appear to be assigned to a ghost user
Diffstat (limited to 'models/issue_list.go')
-rw-r--r-- | models/issue_list.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/models/issue_list.go b/models/issue_list.go index c317f1a157..cef4ec03c7 100644 --- a/models/issue_list.go +++ b/models/issue_list.go @@ -69,6 +69,9 @@ func (issues IssueList) loadPosters(e Engine) error { } for _, issue := range issues { + if issue.PosterID <= 0 { + continue + } var ok bool if issue.Poster, ok = posterMaps[issue.PosterID]; !ok { issue.Poster = NewGhostUser() @@ -176,6 +179,9 @@ func (issues IssueList) loadAssignees(e Engine) error { } for _, issue := range issues { + if issue.AssigneeID <= 0 { + continue + } var ok bool if issue.Assignee, ok = assigneeMaps[issue.AssigneeID]; !ok { issue.Assignee = NewGhostUser() |