From f2487e2ea63f66a2665fc0090a40b2160e7b15c5 Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Thu, 21 Nov 2024 19:02:09 +0900 Subject: [PATCH] [bugfix] Fix the error: Uncaught TypeError: Cannot read properties of null (reading 'scrollTop') I just put Early return, though. --- .../main_page/main_section/message_container/log_box/LogBox.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src-ui/app/main_page/main_section/message_container/log_box/LogBox.jsx b/src-ui/app/main_page/main_section/message_container/log_box/LogBox.jsx index b5f24918..1977171e 100644 --- a/src-ui/app/main_page/main_section/message_container/log_box/LogBox.jsx +++ b/src-ui/app/main_page/main_section/message_container/log_box/LogBox.jsx @@ -21,6 +21,7 @@ export const LogBox = () => { useEffect(() => { const handleScroll = () => { const element = log_container_ref.current; + if (!element) return; const currentScrollTop = element.scrollTop; const at_bottom = element.scrollHeight - currentScrollTop === element.clientHeight;