From ac93afd1899ddd283eb3daea5521227f80b95ec8 Mon Sep 17 00:00:00 2001 From: David Florness Date: Sat, 22 May 2021 15:30:29 -0400 Subject: [PATCH] Insert panic to help root out bug --- election/msg.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/election/msg.go b/election/msg.go index 5798f0d..fee54e0 100644 --- a/election/msg.go +++ b/election/msg.go @@ -140,6 +140,10 @@ func (elections *ElectionsMap) SetupEventHooks(client *mautrix.Client, syncer ma // TODO: this is a freaking mess wrapper := func(f func(*event.Event, *mautrix.Client) bool) func(*event.Event) bool { return func(evt *event.Event) bool { + if evt == nil { + // TODO: this is only here to help find a bug + panic("evt is nil") + } if evt.Unsigned.RedactedBecause != nil { log.Debugf("event %s was redacted", evt.ID) return false -- 2.38.4