diff --git a/client/src/components/eula/eula.component.jsx b/client/src/components/eula/eula.component.jsx index f28742b0b..a0db9e534 100644 --- a/client/src/components/eula/eula.component.jsx +++ b/client/src/components/eula/eula.component.jsx @@ -25,6 +25,7 @@ const Eula = ({ currentEula, currentUser, acceptEula }) => { const handleScroll = useCallback( (e) => { + if (!e.target) return; const bottom = e.target.scrollHeight - 100 <= e.target.scrollTop + e.target.clientHeight; if (bottom && !hasEverScrolledToBottom) { setHasEverScrolledToBottom(true); @@ -36,7 +37,9 @@ const Eula = ({ currentEula, currentUser, acceptEula }) => { ); useEffect(() => { - handleScroll({ target: markdownCardRef.current }); + if (markdownCardRef.current) { + handleScroll({ target: markdownCardRef.current }); + } }, [handleScroll]); const handleChange = useCallback(() => {