aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2020-10-08 14:46:25 +0100
committerNeil Alexander <neilalexander@users.noreply.github.com>2020-10-08 14:46:25 +0100
commit8035c50c066209108f9ccefebb9e12fdc1df3cab (patch)
treeb5839e4562e8cf572a18c57d321a6721bad06b85
parent78f6e1a31e9d034d8ffca28d38830d014a82e64f (diff)
Don't get into situations where we have no forward extremities
-rw-r--r--roomserver/internal/input/input_latest_events.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/roomserver/internal/input/input_latest_events.go b/roomserver/internal/input/input_latest_events.go
index b6666cc0..229665a0 100644
--- a/roomserver/internal/input/input_latest_events.go
+++ b/roomserver/internal/input/input_latest_events.go
@@ -296,7 +296,7 @@ func (u *latestEventsUpdater) calculateLatest(
referenced, err := u.updater.IsReferenced(newEvent.EventReference)
if err != nil {
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)
}