fix: fix crashes on join and permission removed

Fixes #14444 and #14447

The problem was that we accessed a categoryItem that might not have existed yet.
This commit is contained in:
Jonathan Rainville 2024-04-16 14:54:32 -04:00
parent 81f5349252
commit 75e1d3151f
1 changed files with 1 additions and 1 deletions

View File

@ -679,7 +679,7 @@ proc addNewChat(
memberRole = community.memberRole
var categoryOpened = true
if chatDto.categoryId != "":
if chatDto.categoryId != "" and self.doesCatOrChatExist(chatDto.categoryId):
let categoryItem = self.view.chatsModel.getItemById(chatDto.categoryId)
categoryOpened = categoryItem.categoryOpened
if channelGroup.id != "":