From da095bfed87ff8bf838cc969689525ef5242335e Mon Sep 17 00:00:00 2001 From: Fabio Bonelli Date: Thu, 20 Aug 2020 12:47:16 +0200 Subject: [PATCH] Fix undefined dereference. --- src/app/components/editorForm.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/components/editorForm.js b/src/app/components/editorForm.js index 01e1908f..0a61cd62 100644 --- a/src/app/components/editorForm.js +++ b/src/app/components/editorForm.js @@ -114,14 +114,14 @@ const EditForm = props => { } else { params.activeKey = activeSection == 0 ? "0" : ""; } - + let sectionsWithErrors = []; //submitFailed && - + if (submitFailed && errors) { sectionsWithErrors = Object.keys(errors).reduce((s, e) => { let field = getFieldByTitle(allFields, e); - if (s.indexOf(field.section) < 0) { + if (field && s.indexOf(field.section) < 0) { s.push(field.section); } return s;