Commit 1b5e00e7 authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Fix assert when inserting a chat room in DB.

parent 25d8ff14
......@@ -106,9 +106,13 @@ shared_ptr<AbstractChatRoom> CorePrivate::createClientGroupChatRoom (const strin
void CorePrivate::insertChatRoom (const shared_ptr<AbstractChatRoom> &chatRoom) {
L_ASSERT(chatRoom);
L_ASSERT(!chatRoomsById[chatRoom->getChatRoomId()]);
chatRooms.push_back(chatRoom);
chatRoomsById[chatRoom->getChatRoomId()] = chatRoom;
L_ASSERT(!chatRoomsById[chatRoom->getChatRoomId()]
|| (chatRoomsById[chatRoom->getChatRoomId()] == chatRoom)
);
if (!chatRoomsById[chatRoom->getChatRoomId()]) {
chatRooms.push_back(chatRoom);
chatRoomsById[chatRoom->getChatRoomId()] = chatRoom;
}
}
void CorePrivate::insertChatRoomWithDb (const shared_ptr<AbstractChatRoom> &chatRoom) {
......
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