From cd98ca24c45a9cb4302612e1786b2f0cd0eafcdf Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Thu, 7 Nov 2024 02:09:48 +0900 Subject: [PATCH] Only delete proxy password when it is, in fact, previously present in the settings Prevent error on deletion when the proxy password does not exist Signed-off-by: Claudio Cambra --- src/gui/accountmanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/accountmanager.cpp b/src/gui/accountmanager.cpp index a6b96d45b918c..b319b3b9b9d1e 100644 --- a/src/gui/accountmanager.cpp +++ b/src/gui/accountmanager.cpp @@ -357,7 +357,7 @@ void AccountManager::saveAccountHelper(Account *acc, QSettings &settings, bool s settings.setValue(networkDownloadLimitC, acc->downloadLimit()); const auto proxyPasswordKey = QString(acc->userIdAtHostWithPort() + networkProxyPasswordKeychainKeySuffixC); - if (const auto proxyPassword = acc->proxyPassword(); proxyPassword.isEmpty()) { + if (const auto proxyPassword = acc->proxyPassword(); proxyPassword.isEmpty() && settings.value(proxyPasswordKey).isValid()) { const auto job = new QKeychain::DeletePasswordJob(Theme::instance()->appName(), this); job->setKey(proxyPasswordKey); connect(job, &QKeychain::Job::finished, this, [](const QKeychain::Job *const incomingJob) {