Skip to content

Commit

Permalink
Merge pull request #439 from beda-software/patch-enable-when
Browse files Browse the repository at this point in the history
PATCH: enableWhen util to handle empty arrays
  • Loading branch information
alexlipovka authored Jan 27, 2025
2 parents 5b89dfa + d508de6 commit 054c6c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/enableWhen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as yup from 'yup';

function getAnswerOptionsValues(answerOptionArray: QuestionnaireItemAnswerOption[]): Array<{ value: any }> {
return answerOptionArray.reduce<Array<{ value: any }>>((acc, option) => {
if (option.value === undefined) {
if (option?.value === undefined) {
return acc;
}

Expand Down

0 comments on commit 054c6c8

Please sign in to comment.