Merge pull request #1823 from brlo/patch-1

check 'defaultValue' before calling 'replace'
This commit is contained in:
Tony Tam
2015-12-17 14:04:51 -05:00

View File

@@ -32,7 +32,9 @@ Handlebars.registerHelper('renderTextParam', function(param) {
idAtt = ' id=\'' + param.valueId + '\''; idAtt = ' id=\'' + param.valueId + '\'';
} }
if (typeof defaultValue === 'string' || defaultValue instanceof String) {
defaultValue = defaultValue.replace(/'/g,'''); defaultValue = defaultValue.replace(/'/g,''');
}
if(isArray) { if(isArray) {
result = '<textarea class=\'body-textarea' + (param.required ? ' required' : '') + '\' name=\'' + param.name + '\'' + idAtt + dataVendorExtensions; result = '<textarea class=\'body-textarea' + (param.required ? ' required' : '') + '\' name=\'' + param.name + '\'' + idAtt + dataVendorExtensions;