Skip to content

Commit

Permalink
Validate http_user value before assigning it to user in the config file.
Browse files Browse the repository at this point in the history
Signed-off-by: Camila Ayres <[email protected]>
  • Loading branch information
camilasan committed Oct 31, 2024
1 parent b3bd1bf commit 7f39a69
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/gui/accountmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,12 +393,16 @@ void AccountManager::saveAccountHelper(Account *acc, QSettings &settings, bool s

const auto settingsMapKeys = acc->_settingsMap.keys();
for (const auto &key : settingsMapKeys) {
if (!acc->_settingsMap.value(key).isValid()) {
continue;
}

settings.setValue(key, acc->_settingsMap.value(key));
}
settings.setValue(QLatin1String(authTypeC), acc->_credentials->authType());

// HACK: Save http_user also as user
if (acc->_settingsMap.contains(httpUserC)) {
if (acc->_settingsMap.contains(httpUserC) && acc->_settingsMap.value(httpUserC).isValid()) {
settings.setValue(userC, acc->_settingsMap.value(httpUserC));
}
}
Expand Down

0 comments on commit 7f39a69

Please sign in to comment.