From c8dd7b42e717688073213502d1eafe4892b9e77d Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 13 Oct 2020 13:10:35 +0200 Subject: [PATCH] encountered this very unlikely race while testing, so prevent it --- src/matrix/room/timeline/Timeline.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/matrix/room/timeline/Timeline.js b/src/matrix/room/timeline/Timeline.js index 6247b4c7..8cad17a1 100644 --- a/src/matrix/room/timeline/Timeline.js +++ b/src/matrix/room/timeline/Timeline.js @@ -75,6 +75,9 @@ export class Timeline { // tries to prepend `amount` entries to the `entries` list. async loadAtTop(amount) { + if (this._disposables.isDisposed) { + return; + } const firstEventEntry = this._remoteEntries.array.find(e => !!e.eventType); if (!firstEventEntry) { return;