diff --git a/ui/component/livestreamComments/view.jsx b/ui/component/livestreamComments/view.jsx index 0058d8adb..5d570355b 100644 --- a/ui/component/livestreamComments/view.jsx +++ b/ui/component/livestreamComments/view.jsx @@ -84,8 +84,8 @@ export default function LivestreamComments(props: Props) { function handleScroll() { if (discussionElement) { - const negativeCommentHeight = (-1 * commentElement.offsetHeight); - const isAtRecent = discussionElement.scrollTop >= negativeCommentHeight; + const negativeCommentHeight = commentElement && (-1 * commentElement.offsetHeight); + const isAtRecent = negativeCommentHeight && (discussionElement.scrollTop >= negativeCommentHeight); setScrollBottom(isAtRecent); }