From aa6eabcf5721d311b046e255da3d2e8625ed057f Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 3 Feb 2020 15:49:18 +0000 Subject: [PATCH] Don't crash immediately if the room directory chunk is null/empty Fixes https://github.com/vector-im/riot-web/issues/12197 --- src/components/structures/RoomDirectory.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/structures/RoomDirectory.js b/src/components/structures/RoomDirectory.js index 42dbc1b4e4..dd089a9776 100644 --- a/src/components/structures/RoomDirectory.js +++ b/src/components/structures/RoomDirectory.js @@ -155,7 +155,7 @@ export default createReactClass({ this.nextBatch = data.next_batch; this.setState((s) => { - s.publicRooms.push(...data.chunk); + s.publicRooms.push(...(data.chunk || [])); s.loading = false; return s; });