Skip to content

Commit

Permalink
Merge pull request #289 from privacy-scaling-explorations/fix/project…
Browse files Browse the repository at this point in the history
…-index-mapping

fix: ensure index 0 does not throw
  • Loading branch information
ctrlc03 authored Aug 30, 2024
2 parents f0ff7c2 + 6dea827 commit 45eeb2e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const SubmitBallotButton = (): JSX.Element => {
const handleSubmitBallot = useCallback(async () => {
const votes = ballot.votes.map(({ amount, projectId }) => {
const index = projectIndices[projectId];
if (!index) {
if (index === undefined || index === -1) {
throw new Error("There are some problems due to project index mapping.");
}

Expand Down

0 comments on commit 45eeb2e

Please sign in to comment.