Skip to content

Commit 4a38706

Browse files
committed
fix: vote is undefined if the juror didn't vote
1 parent 8e8fa39 commit 4a38706

File tree

1 file changed

+2
-2
lines changed
  • src/app/[locale]/case/[disputeId]/components

1 file changed

+2
-2
lines changed

src/app/[locale]/case/[disputeId]/components/Votes.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ const Votes: React.FC<IVotes> = async ({ disputeId }) => {
3939

4040
const jurors = voteData.rounds[0].drawnJurors.reduce(
4141
(acc: IJurorData, draw) => {
42-
const juror = draw.vote.juror.id;
42+
const juror = draw.vote?.juror.id;
4343
if (acc[juror]) {
4444
acc[juror].weight = acc[juror].weight + 1;
45-
} else {
45+
} else if (typeof juror !== "undefined") {
4646
acc[juror] = {
4747
shortAddress: shortenAddress(juror),
4848
weight: 1,

0 commit comments

Comments
 (0)