From a27154ad47a5b779bf723150bc3ea06ca41d0f49 Mon Sep 17 00:00:00 2001 From: varjolintu Date: Sat, 13 Mar 2021 14:16:04 +0200 Subject: [PATCH] Add check for form --- keepassxc-browser/content/keepassxc-browser.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/keepassxc-browser/content/keepassxc-browser.js b/keepassxc-browser/content/keepassxc-browser.js index 19249fb..240aa67 100755 --- a/keepassxc-browser/content/keepassxc-browser.js +++ b/keepassxc-browser/content/keepassxc-browser.js @@ -388,6 +388,10 @@ kpxcFields.getAllCombinations = async function(inputs) { // Adds segmented TOTP fields to the combination if found kpxcFields.getSegmentedTOTPFields = function(inputs, combinations) { const form = inputs.length > 0 ? inputs[0].form : undefined; + if (!form) { + return combinations; + } + if (acceptedOTPFields.some(f => form.className.includes(f) || form.id.includes(f) || form.name.includes(f)) || form.length === 6) { const totpInputs = Array.from(form.elements).filter(e => e.nodeName === 'INPUT' && e.type !== 'password');