From d2281896c3a4f1c42d34adcd5076b62ae036acb8 Mon Sep 17 00:00:00 2001 From: David Florness Date: Fri, 31 Dec 2021 21:09:04 -0600 Subject: [PATCH] Don't panic in event handlers on nil event This is causing panics in (*EventStore).getAndHandleEvent --- election/msg.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/election/msg.go b/election/msg.go index 3951720..50c9671 100644 --- a/election/msg.go +++ b/election/msg.go @@ -143,7 +143,7 @@ func (elections *ElectionsMap) SetupEventHooks(client *mautrix.Client, syncer ma return func(evt *event.Event) bool { if evt == nil { // TODO: this is only here to help find a bug - panic("evt is nil") + log.Debugf("evt is nil") } if evt.Unsigned.RedactedBecause != nil { log.Debugf("event %s was redacted", evt.ID) -- 2.38.4