From 190968c73c65a971b8ff27f91699587eee43de85 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 28 Mar 2022 09:58:49 +0100 Subject: [PATCH] Null guard TimelinePanel unmount edge (#8171) --- src/components/structures/TimelinePanel.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/structures/TimelinePanel.tsx b/src/components/structures/TimelinePanel.tsx index 63f484f9b0..96b892245b 100644 --- a/src/components/structures/TimelinePanel.tsx +++ b/src/components/structures/TimelinePanel.tsx @@ -559,7 +559,7 @@ class TimelinePanel extends React.Component { // updates from pagination will happen when the paginate completes. if (toStartOfTimeline || !data || !data.liveEvent) return; - if (!this.messagePanel.current) return; + if (!this.messagePanel.current?.getScrollState()) return; if (!this.messagePanel.current.getScrollState().stuckAtBottom) { // we won't load this event now, because we don't want to push any @@ -570,7 +570,7 @@ class TimelinePanel extends React.Component { } // tell the timeline window to try to advance itself, but not to make - // an http request to do so. + // a http request to do so. // // we deliberately avoid going via the ScrollPanel for this call - the // ScrollPanel might already have an active pagination promise, which