From f6ac62bbced80e111ebef9b83e61a6a6f4e7b0ca Mon Sep 17 00:00:00 2001 From: David Florness Date: Tue, 19 Jan 2021 19:07:01 -0500 Subject: [PATCH] Only fix Election.Joins on unmarshal if localvoter exists --- election/election.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/election/election.go b/election/election.go index 8d2deee..56693c3 100644 --- a/election/election.go +++ b/election/election.go @@ -47,6 +47,8 @@ func (el *Election) UnmarshalJSON(b []byte) error { return err } // ensure these are the same pointer - el.Joins[el.LocalVoter.JoinEvt.ID] = el.LocalVoter.Voter + if el.LocalVoter != nil { + el.Joins[el.LocalVoter.JoinEvt.ID] = el.LocalVoter.Voter + } return nil } -- 2.38.4