Skip to content

Commit

Permalink
fix: handle missing inferred title field (#3239)
Browse files Browse the repository at this point in the history
  • Loading branch information
erezrokah committed Feb 12, 2020
1 parent 3678053 commit ca8cf71
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ca8cf71

Please sign in to comment.