From fd938b49189ffea477e567f49f2f38bc7a668df6 Mon Sep 17 00:00:00 2001 From: William Banfield Date: Thu, 13 Jan 2022 16:56:37 -0500 Subject: [PATCH] nil check when dereferencing voteSet.votes --- types/vote_set.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/vote_set.go b/types/vote_set.go index fe6c0fd51..dba5a5cf0 100644 --- a/types/vote_set.go +++ b/types/vote_set.go @@ -385,7 +385,9 @@ func (voteSet *VoteSet) List() []Vote { } votes := make([]Vote, len(voteSet.votes)) for i := range voteSet.votes { - votes[i] = *voteSet.votes[i] + if voteSet.votes[i] != nil { + votes[i] = *voteSet.votes[i] + } } return votes }