Skip to content

Commit 367ff32

Browse files
ethantkoeniglunny
authored andcommitted
Use ghost users in issues/PRs (#1831)
1 parent 2525195 commit 367ff32

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

models/issue_list.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ func (issues IssueList) loadPosters(e Engine) error {
6969
}
7070

7171
for _, issue := range issues {
72-
issue.Poster = posterMaps[issue.PosterID]
72+
var ok bool
73+
if issue.Poster, ok = posterMaps[issue.PosterID]; !ok {
74+
issue.Poster = NewGhostUser()
75+
}
7376
}
7477
return nil
7578
}
@@ -173,7 +176,10 @@ func (issues IssueList) loadAssignees(e Engine) error {
173176
}
174177

175178
for _, issue := range issues {
176-
issue.Assignee = assigneeMaps[issue.AssigneeID]
179+
var ok bool
180+
if issue.Assignee, ok = assigneeMaps[issue.AssigneeID]; !ok {
181+
issue.Assignee = NewGhostUser()
182+
}
177183
}
178184
return nil
179185
}

0 commit comments

Comments
 (0)