MediaPlaceholder component errors when allowedTypes is not set. #11692
Labels
[Feature] Media
Anything that impacts the experience of managing media
[Type] Bug
An existing feature does not function as intended
Milestone
Describe the bug
When the
MediaPlaceholder
component is used and noallowedTypes
property is provided, the component throws an error because it tries to access.length
on anundefined
value.To Reproduce
edit()
methodTypeError: Cannot read property 'length' of undefined
in the console.Expected behavior
The
MediaUpload
component specifies thatallowedTypes
an optional property; I would therefore expectMediaPlaceholder
to behave the same, especially given that there is already code to check whetherallowedTypes
is unset elsewhere inMediaPlaceholder
.Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: