Bug 278 - Allow updating of NSD when there are instantiated network services
[osm/UI.git] / skyquake / plugins / composer / src / src / components / EditDescriptorModelProperties.js
index c923ede..651c40d 100644 (file)
@@ -324,7 +324,7 @@ export default function EditDescriptorModelProperties(props) {
                        // We stick in a string when the user actually sets it to simplify things
                        // but the correct thing happens when we serialize to user data
                        let isEmptyLeafPresent = (value === EMPTY_LEAF_PRESENT || value === null); 
-                       let present = isEmptyLeafPresent ? EMPTY_LEAF_PRESENT : "";
+                       let present = isEmptyLeafPresent ? EMPTY_LEAF_PRESENT : [null];
                        const options = [
                                <option key={'true'} value={EMPTY_LEAF_PRESENT}>Enabled</option>,
                                <option key={'false'} value="">Not Enabled</option>
@@ -538,7 +538,7 @@ export default function EditDescriptorModelProperties(props) {
                                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];
                                        }