X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FUI.git;a=blobdiff_plain;f=skyquake%2Fplugins%2Fcomposer%2Fsrc%2Fsrc%2Fcomponents%2FEditDescriptorModelProperties.js;h=ad2bf3dc986ece04f29f74c5d2f7b9a14adf4541;hp=0e1746dda78f4af8ecf757e55d0cbe8b8b35e0f0;hb=0d40bcd8ad88f3749ff70466d0353ff23070d924;hpb=33630ac4f36a791162d45f1143cff56b33af9b5b diff --git a/skyquake/plugins/composer/src/src/components/EditDescriptorModelProperties.js b/skyquake/plugins/composer/src/src/components/EditDescriptorModelProperties.js index 0e1746dda..ad2bf3dc9 100644 --- a/skyquake/plugins/composer/src/src/components/EditDescriptorModelProperties.js +++ b/skyquake/plugins/composer/src/src/components/EditDescriptorModelProperties.js @@ -531,14 +531,14 @@ export default function EditDescriptorModelProperties(props) { if(fieldProperties) { //Check each case statement in model and see if it is present in container model. cases.map(function(c){ - if(fieldProperties.hasOwnProperty(c.optionValue.split('.')[1])) { + if(c.optionValue && fieldProperties.hasOwnProperty(c.optionValue.split('.')[1])) { utils.assignPathValue(container.model, ['uiState.choice', pathToChoice, 'selected'].join('.'), c.optionValue); } }); selectedOptionValue = utils.resolvePath(container.model, ['uiState.choice', pathToChoice, 'selected'].join('.')); } else { property.properties.map(function(p) { - let pname = p.properties[0].name; + let pname = p.properties[0] && p.properties[0].name; if(container.model.hasOwnProperty(pname)) { utils.assignPathValue(container.model, ['uiState.choice', pathToChoice, 'selected'].join('.'), [p.name, pname].join('.')); } @@ -747,7 +747,7 @@ export default function EditDescriptorModelProperties(props) { value = utils.resolvePath(container.model, ['uiState.choice'].concat(path, 'selected').join('.')); if(!value) { property.properties.map(function(p) { - let pname = p.properties[0].name; + let pname = p.properties[0] && p.properties[0].name; if(container.model.hasOwnProperty(pname)) { value = container.model[pname]; }