Skip to content

Commit

Permalink
Fix null
Browse files Browse the repository at this point in the history
  • Loading branch information
selankon committed Oct 30, 2024
1 parent 8fc54f9 commit ee98753
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const QuestionsFormProvider: React.FC<
return (
<FormProvider {...fmethods}>
<QuestionsFormContext.Provider
value={{ fmethods, renderWith: props.renderWith, validate: props.validate, ...multiElections }}
value={{ fmethods, renderWith: props.renderWith ?? [], validate: props.validate, ...multiElections }}
>
{children}
</QuestionsFormContext.Provider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ export const MultiElectionVoted = () => {
if (!voted) {
return null
}
const votes = Object.values(elections).map((e) => e.voted)
const votes = Object.values(elections)
.map((e) => e.voted)
.filter((voted) => voted !== null)
return <VotedLogic votes={votes} />
}

Expand Down

0 comments on commit ee98753

Please sign in to comment.