diff --git a/keepassxc-browser/keepassxc-browser.js b/keepassxc-browser/keepassxc-browser.js index a6c63a8..49c1ceb 100644 --- a/keepassxc-browser/keepassxc-browser.js +++ b/keepassxc-browser/keepassxc-browser.js @@ -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); } }