diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 225e92ad9..9f500751f 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -548,10 +548,13 @@ L.Control.JSDialogBuilder = L.Control.extend({ }, _frameHandler: function(parentContainer, data, builder) { - data.text = builder._cleanText(data.children[0].text); - var contentNode = data.children[1]; - - builder._explorableEntry(parentContainer, data, contentNode, builder); + if (data.children.length > 1) { + data.text = builder._cleanText(data.children[0].text); + var contentNode = data.children[1]; + builder._explorableEntry(parentContainer, data, contentNode, builder); + } else { + return true; + } return false; }, @@ -1823,6 +1826,9 @@ L.Control.JSDialogBuilder = L.Control.extend({ build: function(parent, data) { this._amendJSDialogData(data); for (var childIndex in data) { + if (!data[childIndex]) + continue; + var childData = data[childIndex]; if (!childData) continue;