Skip to content
Snippets Groups Projects
Commit c931e184 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

account_manager: avoid useless log if cert or key is absent

Change-Id: I81925d7e8bd0e5dcbc58bcd8771526028657c99e
parent c87d8c5f
No related branches found
No related tags found
No related merge requests found
...@@ -112,10 +112,15 @@ AccountManager::loadIdentity(const std::string& accountId, ...@@ -112,10 +112,15 @@ AccountManager::loadIdentity(const std::string& accountId,
const std::string& key_path, const std::string& key_path,
const std::string& key_pwd) const const std::string& key_pwd) const
{ {
JAMI_DBG("Loading certificate from '%s' and key from '%s' at %s", // Return to avoid unnecessary log if certificate or key is missing. Example case: when
crt_path.c_str(), // importing an account when the certificate has not been unpacked from the archive.
key_path.c_str(), if (crt_path.empty() or key_path.empty())
path_.c_str()); return {};
JAMI_DEBUG("Loading certificate from '{}' and key from '{}' at {}",
crt_path,
key_path,
path_);
try { try {
dht::crypto::Certificate dht_cert(fileutils::loadFile(crt_path, path_)); dht::crypto::Certificate dht_cert(fileutils::loadFile(crt_path, path_));
dht::crypto::PrivateKey dht_key(fileutils::loadFile(key_path, path_), key_pwd); dht::crypto::PrivateKey dht_key(fileutils::loadFile(key_path, path_), key_pwd);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment