api-platform / admin

A beautiful and fully-featured administration interface builder for hypermedia APIs
https://api-platform.com/docs/admin/
MIT License
483 stars 131 forks source link

fix(dataprovider): do not add properties with null value in FormData #402

Closed f-jost closed 3 years ago

f-jost commented 3 years ago
Q A
Branch? main
Tickets -
License MIT
Doc PR -

Fix TypeError: Cannot read properties of null (reading 'toJSON').

When selecting an empty value from a react-admin field that allow null value like ReferenceInput, the error occurs when submitting the form that contain a file field where a FormData is used when convert react-admin data to hydra data because the toJSON function cannot be applied on a null value.

alanpoulain commented 3 years ago

Thank you @f-jost!