From b83613924c4061d9ebf72c515bc3c95a7730e3eb Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 3 Jun 2021 09:25:56 +0200 Subject: [PATCH] don't assume there is at least 1 tile before loading at top it can happen that all tiles are not renderable, and we should just keep calling loadAtTop --- src/domain/session/room/timeline/TimelineViewModel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/domain/session/room/timeline/TimelineViewModel.js b/src/domain/session/room/timeline/TimelineViewModel.js index 63791fa3..d91b9acb 100644 --- a/src/domain/session/room/timeline/TimelineViewModel.js +++ b/src/domain/session/room/timeline/TimelineViewModel.js @@ -52,7 +52,7 @@ export class TimelineViewModel extends ViewModel { return true; } const firstTile = this._tiles.getFirst(); - if (firstTile.shape === "gap") { + if (firstTile?.shape === "gap") { return await firstTile.fill(); } else { const topReached = await this._timeline.loadAtTop(10);