From 84bac0afe95e95ce49cb38f583ac933a1ae8b0ba Mon Sep 17 00:00:00 2001 From: Bruno Windels <274386+bwindels@users.noreply.github.com> Date: Sat, 25 Jun 2022 19:33:47 +0200 Subject: [PATCH] Also allow undefined, which means at the end of the paginated direction we already detect the end by chunk.length===0, so we just need to not throw --- src/matrix/room/timeline/persistence/GapWriter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/matrix/room/timeline/persistence/GapWriter.js b/src/matrix/room/timeline/persistence/GapWriter.js index 3e520608..4458e1c5 100644 --- a/src/matrix/room/timeline/persistence/GapWriter.js +++ b/src/matrix/room/timeline/persistence/GapWriter.js @@ -163,7 +163,7 @@ export class GapWriter { if (!Array.isArray(chunk)) { throw new Error("Invalid chunk in response"); } - if (typeof end !== "string") { + if (typeof end !== "string" && typeof end !== "undefined") { throw new Error("Invalid end token in response"); }