Skip to content

Commit

Permalink
fix: vote is undefined if the juror didn't vote
Browse files Browse the repository at this point in the history
  • Loading branch information
alcercu committed Dec 4, 2024
1 parent 8e8fa39 commit 4a38706
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/[locale]/case/[disputeId]/components/Votes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ const Votes: React.FC<IVotes> = async ({ disputeId }) => {

const jurors = voteData.rounds[0].drawnJurors.reduce(
(acc: IJurorData, draw) => {
const juror = draw.vote.juror.id;
const juror = draw.vote?.juror.id;
if (acc[juror]) {
acc[juror].weight = acc[juror].weight + 1;
} else {
} else if (typeof juror !== "undefined") {
acc[juror] = {
shortAddress: shortenAddress(juror),
weight: 1,
Expand Down

0 comments on commit 4a38706

Please sign in to comment.