From 6de9c5a5c35a4151ebd1cc8cfa63761dd0df2713 Mon Sep 17 00:00:00 2001 From: varjolintu Date: Sat, 23 Dec 2017 13:06:31 +0200 Subject: [PATCH] Fixed typeof check --- keepassxc-browser/keepassxc-browser.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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); } }