Skip to content

Commit

Permalink
Only delete proxy password when it is, in fact, previously present in…
Browse files Browse the repository at this point in the history
… the settings

Prevent error on deletion when the proxy password does not exist

Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra committed Nov 6, 2024
1 parent a255c1f commit cd98ca2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gui/accountmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit cd98ca2

Please sign in to comment.