Fix case with no field specifier

This commit is contained in:
Valentin Boettcher 2019-03-06 14:13:30 +01:00
parent 3f7e1f4d8d
commit 6a7a70aada

View file

@ -217,13 +217,14 @@ class SmartForm extends Component {
Get a list of children-fields for a nested field. Get a list of children-fields for a nested field.
*/ */
getChildFields = fieldName => this.props.fields.reduce((filtered, field) => { getChildFields = fieldName => this.props.fields &&
const child = field.replace(new RegExp(`^${fieldName}\\.`), ''); this.props.fields.reduce((filtered, field) => {
if(child !== field) const child = field.replace(new RegExp(`^${fieldName}\\.`), '');
return filtered ? filtered.push(child) : [child]; if(child !== field)
return filtered ? filtered.push(child) : [child];
return filtered; return filtered;
}, null); }, null);
/* /*