diff --git a/src/core/core-chat-room.cpp b/src/core/core-chat-room.cpp index 599513e4a..9c9eb07f3 100644 --- a/src/core/core-chat-room.cpp +++ b/src/core/core-chat-room.cpp @@ -254,8 +254,18 @@ void Core::deleteChatRoom (const shared_ptr &chatRoom) { const ChatRoomId &chatRoomId = chatRoom->getChatRoomId(); auto it = d->chatRoomsById.find(chatRoomId); if (it != d->chatRoomsById.end()) { - auto it = find(d->chatRooms.begin(), d->chatRooms.end(), chatRoom); - L_ASSERT(it != d->chatRooms.end()); + + // TODO: Remove me later. + auto it = find_if( + d->chatRooms.begin(), d->chatRooms.end(), + [&chatRoomId](const shared_ptr &chatRoom) { + return chatRoom->getChatRoomId() == chatRoomId; + } + ); + + // FIXME: Use this code in the future. (Wait for signals.) + // auto it = find(d->chatRooms.begin(), d->chatRooms.end(), chatRoom); + // L_ASSERT(it != d->chatRooms.end()); d->chatRooms.erase(it); d->mainDb->deleteChatRoom(chatRoomId); }