From 7ed965e0187d0fd767fee0a778fa6834099e3a1e Mon Sep 17 00:00:00 2001 From: vbersch Date: Tue, 28 Jan 2020 15:01:35 +0100 Subject: [PATCH] fix(ObjectPage): fix crash when unmounted ObjectPage tries to asynchronously set scrollbar height (#294) --- packages/main/src/components/ObjectPage/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/main/src/components/ObjectPage/index.tsx b/packages/main/src/components/ObjectPage/index.tsx index 49d41badc2a..add376499d9 100644 --- a/packages/main/src/components/ObjectPage/index.tsx +++ b/packages/main/src/components/ObjectPage/index.tsx @@ -153,6 +153,7 @@ const ObjectPage: FC = forwardRef((props: ObjectPagePropTyp heightDiff = heightDiff > 0 ? heightDiff : 0; fillerDivDomRef.current.style.height = `${heightDiff}px`; requestAnimationFrame(() => { + if(!contentScrollContainer.current || !topHeader.current) return; const scrollbarContainerHeight = contentScrollContainer.current.getBoundingClientRect().height + topHeader.current.getBoundingClientRect().height;