From abd05dc798fdecd7f7fd2d71f936004a94f976bf Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Sun, 10 Jul 2022 12:14:42 +0200 Subject: [PATCH] Follow-up (#1950) --- src/components/left/main/ChatList.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/left/main/ChatList.tsx b/src/components/left/main/ChatList.tsx index 23563a4a..0e2edc73 100644 --- a/src/components/left/main/ChatList.tsx +++ b/src/components/left/main/ChatList.tsx @@ -106,7 +106,7 @@ const ChatList: FC = ({ if (!digit) return; const position = Number(digit) - 1; - if (position > orderedIds!.length - 1) return; + if (position > orderedIds!.length - 1 || position < 0) return; openChat({ id: orderedIds![position], shouldReplaceHistory: true }); }