From 6fea5c3a2a24bd26f41a8f1ceb8e60d121349fcf Mon Sep 17 00:00:00 2001 From: Jonas Zohren <jonas.zohren@tu-dortmund.de> Date: Sun, 18 Oct 2020 16:29:02 +0200 Subject: [PATCH] make roomList more data safe --- online_status_list/src/RoomOnlineListPanel.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/online_status_list/src/RoomOnlineListPanel.svelte b/online_status_list/src/RoomOnlineListPanel.svelte index 876d1dd..749989f 100644 --- a/online_status_list/src/RoomOnlineListPanel.svelte +++ b/online_status_list/src/RoomOnlineListPanel.svelte @@ -16,11 +16,13 @@ interface Room { export let title: string; export let rooms: Room[]; + +$: safeRoomList = Array.isArray(rooms) ? rooms : []; </script> <nav class="panel is-primary"> <p class="panel-heading">{title}</p> - {#each rooms as room (room.url)} + {#each safeRoomList as room (room.url)} <SingleRoomPanelBlock {...room} /> {/each} </nav> -- GitLab