Don't get into situations where we have no forward extremities

This commit is contained in:
Neil Alexander 2020-10-08 14:46:25 +01:00
parent 78f6e1a31e
commit 8035c50c06
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -296,7 +296,7 @@ func (u *latestEventsUpdater) calculateLatest(
referenced, err := u.updater.IsReferenced(newEvent.EventReference) referenced, err := u.updater.IsReferenced(newEvent.EventReference)
if err != nil { if err != nil {
logrus.WithError(err).Errorf("Failed to retrieve event reference for %q", newEvent.EventReference.EventID) logrus.WithError(err).Errorf("Failed to retrieve event reference for %q", newEvent.EventReference.EventID)
} else if !referenced { } else if !referenced || len(newLatest) == 0 {
newLatest = append(newLatest, newEvent) newLatest = append(newLatest, newEvent)
} }