mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-14 17:51:44 +03:00
cache: don't store legacy identities IDs in bug excerpt as they are not reachable. Fix a panic
This commit is contained in:
parent
6343c8e611
commit
f093be96e9
16
cache/bug_excerpt.go
vendored
16
cache/bug_excerpt.go
vendored
@ -61,14 +61,18 @@ func (l LegacyAuthorExcerpt) DisplayName() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewBugExcerpt(b bug.Interface, snap *bug.Snapshot) *BugExcerpt {
|
func NewBugExcerpt(b bug.Interface, snap *bug.Snapshot) *BugExcerpt {
|
||||||
participantsIds := make([]entity.Id, len(snap.Participants))
|
participantsIds := make([]entity.Id, 0, len(snap.Participants))
|
||||||
for i, participant := range snap.Participants {
|
for _, participant := range snap.Participants {
|
||||||
participantsIds[i] = participant.Id()
|
if _, ok := participant.(*identity.Identity); ok {
|
||||||
|
participantsIds = append(participantsIds, participant.Id())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
actorsIds := make([]entity.Id, len(snap.Actors))
|
actorsIds := make([]entity.Id, 0, len(snap.Actors))
|
||||||
for i, actor := range snap.Actors {
|
for _, actor := range snap.Actors {
|
||||||
actorsIds[i] = actor.Id()
|
if _, ok := actor.(*identity.Identity); ok {
|
||||||
|
actorsIds = append(actorsIds, actor.Id())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
e := &BugExcerpt{
|
e := &BugExcerpt{
|
||||||
|
Loading…
Reference in New Issue
Block a user