From 4ffab6e6f1a8aac70eedc9f8a6112cd582fa34b5 Mon Sep 17 00:00:00 2001 From: David Florness Date: Tue, 19 Jan 2021 17:58:50 -0500 Subject: [PATCH] Don't vote if election wasn't started --- ui/tui.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ui/tui.go b/ui/tui.go index ae41ced..1440aae 100644 --- a/ui/tui.go +++ b/ui/tui.go @@ -275,6 +275,12 @@ func ElectionTUI(client *mautrix.Client, el *election.Election) { if err := app.SetRoot(frame, true).SetFocus(frame).Run(); err != nil { panic(err) } + + if el.StartEvt == nil { + // election was not started; perhaps user hit C-c? + return + } + el.RLock() candidates := el.Candidates el.RUnlock() -- 2.38.4