diff --git a/src/chat/chat-room/client-group-chat-room.cpp b/src/chat/chat-room/client-group-chat-room.cpp index e1a9e2846..1ae05c8d0 100644 --- a/src/chat/chat-room/client-group-chat-room.cpp +++ b/src/chat/chat-room/client-group-chat-room.cpp @@ -225,7 +225,12 @@ ClientGroupChatRoom::~ClientGroupChatRoom () { L_D(); L_D_T(RemoteConference, dConference); - getCore()->getPrivate()->remoteListEventHandler->removeHandler(dConference->eventHandler.get()); + try { + if (getCore()->getPrivate()->remoteListEventHandler) + getCore()->getPrivate()->remoteListEventHandler->removeHandler(dConference->eventHandler.get()); + } catch (const bad_weak_ptr &) { + // Unable to unregister listener here. Core is destroyed and the listener doesn't exist. + } d->setCallSessionListener(nullptr); }