From 4976547cb24f8febfda6eba09efd6fae9510ddb3 Mon Sep 17 00:00:00 2001 From: varjolintu Date: Sun, 5 Apr 2020 13:14:22 +0300 Subject: [PATCH] Check undefiend when saving credentials --- keepassxc-browser/content/banner.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/keepassxc-browser/content/banner.js b/keepassxc-browser/content/banner.js index daf33a4..62e83d4 100644 --- a/keepassxc-browser/content/banner.js +++ b/keepassxc-browser/content/banner.js @@ -151,7 +151,10 @@ kpxcBanner.saveNewCredentials = async function(credentials = {}) { const args = [ credentials.username, credentials.password, credentials.url ]; // If root group is defined by the user, and there's no default browser group, save the credentials to the root group - if (result.groups[0].children.length === 0 && result.defaultGroup.toLowerCase() === 'root') { + if (result.groups !== undefined + && result.groups.length > 0 + && result.groups[0].children.length === 0 + && result.defaultGroup.toLowerCase() === 'root') { args.push(result.groups[0].name, result.groups[0].uuid); }