From 5b027e878b9d00c75d32bf8e0ef5c29f49ace497 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Fri, 17 Sep 2021 17:17:32 +0300 Subject: [PATCH] Fix exception when opening some chats (#1454) --- src/modules/actions/api/users.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/actions/api/users.ts b/src/modules/actions/api/users.ts index d535168d2..95165832b 100644 --- a/src/modules/actions/api/users.ts +++ b/src/modules/actions/api/users.ts @@ -185,6 +185,10 @@ addReducer('loadProfilePhotos', (global, actions, payload) => { const user = isPrivate ? selectUser(global, profileId) : undefined; const chat = !isPrivate ? selectChat(global, profileId) : undefined; + if (!user && !chat) { + return; + } + (async () => { const result = await callApi('fetchProfilePhotos', user, chat); if (!result || !result.photos) {