Merge pull request #3729 from medteck/fix/field-of-undefined

Fixes 'Cannot read property field of undefined' error
This commit is contained in:
Rijk van Zanten
2021-01-18 10:53:03 -05:00
committed by GitHub

View File

@@ -30,7 +30,7 @@ export default defineDisplay(({ i18n }) => ({
? adjustFieldsForDisplays(getFieldsFromTemplate(options.template), relatedCollection)
: [];
if (fields.includes(primaryKeyField.value.field) === false) {
if (primaryKeyField.value && !fields.includes(primaryKeyField.value.field)) {
fields.push(primaryKeyField.value.field);
}