Commit b0cecc1a authored by Ronan's avatar Ronan Committed by Sylvain Berfini

fix(Imdn): avoid crash in Imdn::send if core is destroyed

parent 61ee4899
......@@ -208,8 +208,12 @@ bool Imdn::aggregationEnabled () const {
}
void Imdn::send () {
if (!linphone_core_is_network_reachable(chatRoom->getCore()->getCCore()))
return;
try {
if (!linphone_core_is_network_reachable(chatRoom->getCore()->getCCore()))
return;
} catch (const bad_weak_ptr &) {
return; // Cannot send imdn if core is destroyed.
}
if (!deliveredMessages.empty() || !displayedMessages.empty()) {
auto imdnMessage = chatRoom->getPrivate()->createImdnMessage(deliveredMessages, displayedMessages);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment