value can be undefined see "local-date" (#2652)

This commit is contained in:
Erik Jan de Wit 2022-05-17 12:19:48 +02:00 committed by GitHub
parent 2e45c89edf
commit 80a398d2ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -148,7 +148,9 @@ export default function NewAttributeSettings() {
const validations = profileConfig.validations?.reduce(
(prevValidations: any, currentValidations: any) => {
prevValidations[currentValidations.key] =
currentValidations.value.length === 0 ? {} : currentValidations.value;
currentValidations.value?.length === 0
? {}
: currentValidations.value;
return prevValidations;
},
{}