From baa92eb1b3ede3258e5a192375f6b8d6b6199a56 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Sat, 4 Dec 2021 13:44:29 +0100 Subject: [PATCH] Fix calling `isListed` on undefined chat --- src/modules/helpers/chats.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/helpers/chats.ts b/src/modules/helpers/chats.ts index e659c5b3e..0e7cda381 100644 --- a/src/modules/helpers/chats.ts +++ b/src/modules/helpers/chats.ts @@ -282,8 +282,9 @@ export function prepareFolderListIds( const pinnedChatIds = folder.excludedChatIds ? new Set(folder.pinnedChatIds) : undefined; const listIds = ([] as string[]).concat(allListIds.active || [], allListIds.archived || []) .filter((id) => { - return filterChatFolder( - chatsById[id], + const chat = chatsById[id]; + return chat && filterChatFolder( + chat, folder, usersById, notifySettings,