From ca8cf71ab0d479547c649fb1fce8e72db6207c27 Mon Sep 17 00:00:00 2001 From: Erez Rokah Date: Wed, 12 Feb 2020 10:54:09 +0200 Subject: [PATCH] fix: handle missing inferred title field (#3239) --- .../src/components/Collection/Entries/EntryCard.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/netlify-cms-core/src/components/Collection/Entries/EntryCard.js b/packages/netlify-cms-core/src/components/Collection/Entries/EntryCard.js index 3776bb04..7e06e107 100644 --- a/packages/netlify-cms-core/src/components/Collection/Entries/EntryCard.js +++ b/packages/netlify-cms-core/src/components/Collection/Entries/EntryCard.js @@ -129,7 +129,9 @@ const mapStateToProps = (state, ownProps) => { const { entry, inferedFields, collection } = ownProps; const label = entry.get('label'); const entryData = entry.get('data'); - const defaultTitle = label || entryData.getIn(keyToPathArray(inferedFields.titleField)); + const defaultTitle = + label || + (inferedFields.titleField && entryData.getIn(keyToPathArray(inferedFields.titleField))); const summaryTemplate = collection.get('summary'); const summary = summaryTemplate ? summaryFormatter(summaryTemplate, entry, collection)