Null-guard for missing root event in thread panel (#7067)

This commit is contained in:
Germain 2021-11-02 11:57:03 +00:00 committed by GitHub
parent 773b147a03
commit 8f8d1f6094
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -81,7 +81,7 @@ const useFilteredThreadsTimelinePanel = ({
// The proper list order should be top-to-bottom, like in social-media newsfeeds. // The proper list order should be top-to-bottom, like in social-media newsfeeds.
filteredThreads.reverse().forEach(([id, thread]) => { filteredThreads.reverse().forEach(([id, thread]) => {
const event = thread.rootEvent; 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( timelineSet.addEventToTimeline(
event, event,
timelineSet.getLiveTimeline(), timelineSet.getLiveTimeline(),