Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,4 @@ tmp/_*
docs/docs.md
docs/.config/doctest.md
docs/roadmap/.~readme.md
documentation/
8 changes: 7 additions & 1 deletion nodes/elements/elementBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ module.exports = {
*/
buildSForm: function buildSForm(node, msg, parent) {
// Make sure node.data is an object or an array - if not, force to array
if (!(Array.isArray(node.data) || node.data.constructor.name === 'Object')) node.data = [node.data]
if (!(Array.isArray(node.data) || (node.data != null && node.data.constructor != null && node.data.constructor.name === 'Object'))) node.data = [node.data]

const err = ''

Expand All @@ -381,6 +381,12 @@ module.exports = {
// Data for this row/element of the form: id, type
const frmRow = frm[rowRef]

// Check that frmRow is a valid object before processing
if (frmRow == null) {
node.warn(`🌐⚠️[uibuilder:uib-element:elementBuilder:buildSForm] Form row at index ${i} is null or undefined. Skipping.`)
return
}

// TODO Check that required properties are present

// Handle non-input inputs
Expand Down