field-form icon indicating copy to clipboard operation
field-form copied to clipboard

Fix the validation of array fields with defaultField

Open fknipp opened this issue 3 years ago • 1 comments

async-validator allows undefined array fields containing a defaultField definition, as long as these are not required. Without this fix an error is thrown by calling map() on undefined. Therefore, an additional check is implemented before validating the elements of the array.

A test case is included in this commit.

Thanks for providing this useful piece of sofware!

fknipp avatar May 09 '21 20:05 fknipp

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/react-component/field-form/Gk5V4WRNc8RGWZCSnukqY1GmUhiE
✅ Preview: https://field-form-git-fork-fknipp-master-react-component.vercel.app

vercel[bot] avatar May 09 '21 20:05 vercel[bot]