~edwargix/tallyard

0cd6e3b74295138d5146acb6330f8641a3045a8a — David Florness 4 years ago ad84ff9
Ignore eval message if the local voter hasn't joined the election
1 files changed, 3 insertions(+), 0 deletions(-)

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