Skip to content

Commit 63951d0

Browse files
author
Rodion
committed
check 'defaultValue' before calling 'replace'
fix error "defaultValue.replace is not a function" when defaultValue is Integer
1 parent 85b0f4b commit 63951d0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/javascript/helpers/handlebars.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ Handlebars.registerHelper('renderTextParam', function(param) {
3232
idAtt = ' id=\'' + param.valueId + '\'';
3333
}
3434

35-
defaultValue = defaultValue.replace(/'/g,''');
35+
if (typeof defaultValue === 'string' || defaultValue instanceof String) {
36+
defaultValue = defaultValue.replace(/'/g,''');
37+
}
3638

3739
if(isArray) {
3840
result = '<textarea class=\'body-textarea' + (param.required ? ' required' : '') + '\' name=\'' + param.name + '\'' + idAtt + dataVendorExtensions;

0 commit comments

Comments
 (0)