From 8034de544b280a527d8ffddaf99182f1409c13f7 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Tue, 31 May 2022 16:19:04 +0100 Subject: [PATCH] Don't panic when entries can't be found --- roomserver/state/state.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roomserver/state/state.go b/roomserver/state/state.go index f5893555a..7f2c0bd68 100644 --- a/roomserver/state/state.go +++ b/roomserver/state/state.go @@ -884,7 +884,7 @@ func (v *StateResolution) resolveConflictsV2( for _, resolvedEvent := range resolvedEvents { entry, ok := eventIDMap[resolvedEvent.EventID()] if !ok { - panic(fmt.Errorf("missing state entry for event ID %q", resolvedEvent.EventID())) + return nil, fmt.Errorf("missing state entry for event ID %q", resolvedEvent.EventID()) } notConflicted = append(notConflicted, entry) }