mirror of
https://github.com/strapi/strapi.git
synced 2025-10-26 07:30:17 +00:00
Merge pull request #20180 from strapi/fix/issue-19660
fix: content could be undefined
This commit is contained in:
commit
6ad256cd15
@ -95,7 +95,7 @@ const hasContent = (
|
|||||||
// Repeatable fields show the ID as fallback, in case the mainField
|
// Repeatable fields show the ID as fallback, in case the mainField
|
||||||
// doesn't have any content
|
// doesn't have any content
|
||||||
if (fieldSchema?.repeatable || !mainField) {
|
if (fieldSchema?.repeatable || !mainField) {
|
||||||
return content.length > 0;
|
return content && Array.isArray(content) && content.length > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const value = content?.[mainField.name];
|
const value = content?.[mainField.name];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user