~edwargix/tallyard

d2281896c3a4f1c42d34adcd5076b62ae036acb8 — David Florness 2 years ago f3c3f65
Don't panic in event handlers on nil event

This is causing panics in (*EventStore).getAndHandleEvent
1 files changed, 1 insertions(+), 1 deletions(-)

M election/msg.go
M election/msg.go => election/msg.go +1 -1
@@ 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)