diff --git a/packages/dnb-eufemia/src/extensions/forms/Field/NationalIdentityNumber/NationalIdentityNumber.tsx b/packages/dnb-eufemia/src/extensions/forms/Field/NationalIdentityNumber/NationalIdentityNumber.tsx index d8117fe13d4..68ba3d1fa13 100644 --- a/packages/dnb-eufemia/src/extensions/forms/Field/NationalIdentityNumber/NationalIdentityNumber.tsx +++ b/packages/dnb-eufemia/src/extensions/forms/Field/NationalIdentityNumber/NationalIdentityNumber.tsx @@ -116,6 +116,8 @@ function NationalIdentityNumber(props: Props) { } function is18YearsOrOlder(value: string) { + if (value === undefined) return false + function getAge(birthDate: Date): number { const today = new Date() const age = today.getFullYear() - birthDate.getFullYear()