Fixed typeof check

This commit is contained in:
varjolintu 2017-12-23 13:06:31 +02:00
parent 24fcb882de
commit 6de9c5a5c3

View file

@ -1483,10 +1483,7 @@ cip.setValueWithChange = function(field, value) {
if (cip.settings.respectMaxLength === true) {
const attribute_maxlength = field.attr('maxlength');
if (typeof attribute_maxlength !== typeof undefined &&
$.isNumeric(attribute_maxlength) === true &&
attribute_maxlength > 0) {
if (attribute_maxlength && $.isNumeric(attribute_maxlength) === true && attribute_maxlength > 0) {
value = value.substr(0, attribute_maxlength);
}
}