Skip to content

Commit

Permalink
fix: ensure index 0 does not throw
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrlc03 committed Aug 30, 2024
1 parent f0ff7c2 commit 6dea827
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 6dea827

Please sign in to comment.