From 0cd6e3b74295138d5146acb6330f8641a3045a8a Mon Sep 17 00:00:00 2001 From: David Florness Date: Sat, 23 Jan 2021 13:45:52 -0500 Subject: [PATCH] Ignore eval message if the local voter hasn't joined the election --- election/msg.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/election/msg.go b/election/msg.go index 9d87d0b..c456d1a 100644 --- a/election/msg.go +++ b/election/msg.go @@ -239,6 +239,9 @@ func OnEvalMessage(client *mautrix.Client, evt *event.Event, elections *Election } el.Lock() defer el.Unlock() + if el.LocalVoter == nil { + return + } encodedEncryptedOutput, ok := content.Outputs[el.LocalVoter.JoinEvt.ID] if !ok { log.Errorf("our user ID was not included in an eval message! The election will be unable to finish; blame %s", evt.Sender) -- 2.38.4