fix(CPP): fix crash on login

This commit is contained in:
MishkaRogachev 2022-08-24 12:53:59 +04:00 committed by Mikhail Rogachev
parent 464476d135
commit b23414e999
1 changed files with 1 additions and 3 deletions

View File

@ -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;