From 217ee015727324fccdd368b6f75978d9689acc97 Mon Sep 17 00:00:00 2001 From: Samuel Rac Date: Thu, 13 Mar 2025 14:11:58 +0100 Subject: [PATCH] Fix Proton Pass importer not importing email when there is no username --- src/format/ProtonPassReader.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/format/ProtonPassReader.cpp b/src/format/ProtonPassReader.cpp index 105adde79..b835406ee 100644 --- a/src/format/ProtonPassReader.cpp +++ b/src/format/ProtonPassReader.cpp @@ -73,7 +73,13 @@ namespace } if (loginMap.contains("itemEmail")) { - entry->attributes()->set("login_email", loginMap.value("itemEmail").toString()); + // Place the email value as the username if empty, otherwise set it as an attribute + const auto email = loginMap.value("itemEmail").toString(); + if (entry->username().isEmpty()) { + entry->setUsername(email); + } else if (!email.isEmpty()) { + entry->attributes()->set("login_email", email); + } } // Set the entry url(s)