payload
payload copied to clipboard
fix: depth field in api view throws error when no value present
Description
Closes #149 in payload-3.0-demo repo.
The depth field in the API view throws an unhandled runtime error when empty. The error is being caused by value.toString() being used without ensuring value exists.
Before: https://github.com/payloadcms/payload/assets/67977755/9ffeee12-8338-4ea6-ad7e-286692eeb26e
After: https://github.com/payloadcms/payload/assets/67977755/ef6e8d05-9967-4505-9979-de885869d2ec
- [X] I have read and understand the CONTRIBUTING.md document in this repository.
Type of change
- [X] Bug fix (non-breaking change which fixes an issue)
Checklist:
- [X] Existing test suite passes locally with my changes