diff --git a/src/sunstone/public/app/opennebula/vm.js b/src/sunstone/public/app/opennebula/vm.js index d046791f4d..44502fd9c7 100644 --- a/src/sunstone/public/app/opennebula/vm.js +++ b/src/sunstone/public/app/opennebula/vm.js @@ -875,8 +875,10 @@ define(function(require) { function isRDPSupported(element) { return ( element.TEMPLATE && element.TEMPLATE.NIC && - element.TEMPLATE.NIC.length > 0 && - element.TEMPLATE.NIC.filter(nic => nic.RDP && nic.RDP == "YES") + Array.isArray(element.TEMPLATE.NIC) && + element.TEMPLATE.NIC.some(function(nic) { + return nic.RDP && nic.RDP == "YES" + }) ); } diff --git a/src/sunstone/public/app/utils/wizard-fields.js b/src/sunstone/public/app/utils/wizard-fields.js index 4b5fa9ffb4..9042875439 100644 --- a/src/sunstone/public/app/utils/wizard-fields.js +++ b/src/sunstone/public/app/utils/wizard-fields.js @@ -52,8 +52,10 @@ define(function(require) { return templateJSON; } - function _retrieveInput(input) { - return TemplateUtils.escapeDoubleQuotes( input.val() ); + function _retrieveInput(value) { + return (value instanceof $) + ? value.val() + : TemplateUtils.escapeDoubleQuotes( value ); } // TODO: wizard_field_64 for fill method