uwazi
uwazi copied to clipboard
client app crashes when a markdown value from metadata is an empty array.
Describe the bug When Markdown metadata property is an empty array (has no value) client crashes when trying to process the value on the markdownToReact helper.
To Reproduce Steps to reproduce the behavior:
- no idea how you can get a metadata value as an empty array, but we have those cases, create one manually if necessary (a markdown one)
- Go to table view and the page should crash.
Expected behavior should show an empty value.
Additional context formatter returns the originalValue if its null/undefined or an empty array, in this case an empty array.
https://github.com/huridocs/uwazi/blob/4d2339c9d79b6a1ceb7afe9af54427a825931dae/app/react/Metadata/helpers/formater.js#L459-L474