From eca1e05379bd0883ff0028182b894c502d438fd6 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Tue, 26 Apr 2022 17:08:58 +0200 Subject: [PATCH] Fix Web Bot attachments (#1845) --- src/global/actions/api/chats.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/global/actions/api/chats.ts b/src/global/actions/api/chats.ts index f0cf2b38a..a6488bc2f 100644 --- a/src/global/actions/api/chats.ts +++ b/src/global/actions/api/chats.ts @@ -612,7 +612,7 @@ addActionHandler('openChatByUsername', async (global, actions, payload) => { const chat = selectCurrentChat(global); if (!commentId) { - if (chat && chat.username === username) { + if (chat && chat.username === username && !startAttach) { actions.focusMessage({ chatId: chat.id, messageId }); return; } @@ -1340,6 +1340,7 @@ async function openChatByUsername( if (!chat) return; const global = getGlobal(); const user = selectUser(global, chat.id); + if (!user) return; const isBot = isUserBot(user); if (!isBot || !user.isAttachMenuBot) {