Skip to content

Commit

Permalink
Merge branch 'task/cht-1301-crash-getLoggingName' into 'release/v5.5.1'
Browse files Browse the repository at this point in the history
CHT-1301. Crash at chatd::Client::getLoggingName (Hotfix for v5.5.1)

See merge request megachat/MEGAchat!1963
  • Loading branch information
jgandres committed Jul 4, 2024
2 parents 1495258 + 388b1ff commit 528e096
Show file tree
Hide file tree
Showing 5 changed files with 1,142 additions and 972 deletions.
9 changes: 5 additions & 4 deletions src/chatClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1058,11 +1058,12 @@ promise::Promise<std::string> Client::decryptChatTitle(uint64_t chatId, const st
return title;
})
.fail(
[wptr, chatId, auxCrypto, lname = getLoggingName()](const ::promise::Error& err)
[wptr, chatId, auxCrypto, lname = std::string{getLoggingName()}](
const ::promise::Error& err)
{
wptr.throwIfDeleted();
KR_LOG_ERROR("%sError decrypting chat title for chat link preview %s:\n%s",
lname,
lname.c_str(),
ID_CSTR(chatId),
err.what());
delete auxCrypto;
Expand Down Expand Up @@ -4389,10 +4390,10 @@ void GroupChatRoom::initChatTitle(const std::string &title, int isTitleEncrypted
case strongvelope::kEncrypted:
mEncryptedTitle = title;
decryptTitle().fail(
[this](const ::promise::Error& e)
[this, lname = std::string{getLoggingName()}](const ::promise::Error& e)
{
KR_LOG_ERROR("%sGroupChatRoom: failed to decrypt title for chat %s: %s",
getLoggingName(),
lname.c_str(),
ID_CSTR(mChatid),
e.what());
});
Expand Down
Loading

0 comments on commit 528e096

Please sign in to comment.