debugged a crash, keys are now fetching, refactored main, added some exceptions instead of ints, debugged termination process

This commit is contained in:
Blue 2023-03-11 19:46:23 +03:00
parent 927bdf0dab
commit 4b68da458f
Signed by untrusted user: blue
GPG key ID: 9B203B252A63EE38
9 changed files with 321 additions and 130 deletions

View file

@ -93,7 +93,9 @@ QXmppTask<QXmpp::TrustLevel> Core::TrustHandler::trustLevel(
Shared::TrustLevel level = Shared::TrustLevel::undecided;
try {
Keys map = cache->getRecord(keyOwnerJid);
level = map.at(keyId);
Keys::const_iterator itr = map.find(keyId);
if (itr != map.end())
level = itr->second;
} catch (const DataBase::NotFound& e) {}
return Core::makeReadyTask(std::move(convert(level)));
}