manager: don't delete account if alias is empty

Change-Id: I93cc9a7e2c365bf84f64ef6ffbd05131b76ccfae
This commit is contained in:
Adrien Béraud
2018-10-22 01:07:23 -04:00
parent 87259d0b0e
commit 1e2e3c9a7b

View File

@ -557,13 +557,11 @@ Manager::ManagerPimpl::loadAccount(const YAML::Node &node, int &errorCount,
std::string accountid;
parseValue(node, "id", accountid);
std::string accountAlias;
parseValue(node, "alias", accountAlias);
const auto inAccountOrder = [&](const std::string & id) {
return accountOrder.find(id + "/") != std::string::npos;
};
if (!accountid.empty() and !accountAlias.empty()) {
if (!accountid.empty()) {
if (not inAccountOrder(accountid)) {
RING_WARN("Dropping account %s, which is not in account order", accountid.c_str());
} else if (base_.accountFactory.isSupportedType(accountType.c_str())) {