From 8f8d1f60944c50bb72946481861d9b51386e61b0 Mon Sep 17 00:00:00 2001 From: Germain Date: Tue, 2 Nov 2021 11:57:03 +0000 Subject: [PATCH] Null-guard for missing root event in thread panel (#7067) --- src/components/structures/ThreadPanel.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/structures/ThreadPanel.tsx b/src/components/structures/ThreadPanel.tsx index 307da0ba2e..c7a87945dd 100644 --- a/src/components/structures/ThreadPanel.tsx +++ b/src/components/structures/ThreadPanel.tsx @@ -81,7 +81,7 @@ const useFilteredThreadsTimelinePanel = ({ // The proper list order should be top-to-bottom, like in social-media newsfeeds. filteredThreads.reverse().forEach(([id, thread]) => { const event = thread.rootEvent; - if (timelineSet.findEventById(event.getId()) || event.status !== null) return; + if (!event || timelineSet.findEventById(event.getId()) || event.status !== null) return; timelineSet.addEventToTimeline( event, timelineSet.getLiveTimeline(),