From b23414e999e315672f4417d9806dfb6a6fed4e11 Mon Sep 17 00:00:00 2001 From: MishkaRogachev Date: Wed, 24 Aug 2022 12:53:59 +0400 Subject: [PATCH] fix(CPP): fix crash on login --- libs/ChatSection/src/ChatSectionController.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libs/ChatSection/src/ChatSectionController.cpp b/libs/ChatSection/src/ChatSectionController.cpp index bf23e57bca..2937425b53 100644 --- a/libs/ChatSection/src/ChatSectionController.cpp +++ b/libs/ChatSection/src/ChatSectionController.cpp @@ -33,9 +33,7 @@ ChatItem* ChatSectionController::currentChat() const void ChatSectionController::setCurrentChatIndex(int index) { - assert(index >= 0 && index < m_chats->size()); - - auto chat = m_chats->get(index); + auto chat = index >= 0 && index < m_chats->size() ? m_chats->get(index) : ChatItemPtr(); if (m_currentChat == chat) return;