From 07feed0a916df5cd4bfd73b62fc0842378ff3cfa Mon Sep 17 00:00:00 2001 From: Max Goodhart Date: Tue, 23 Jun 2020 23:42:31 -0700 Subject: [PATCH] Fix crash when API returns error --- src/node/data.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/data.js b/src/node/data.js index 526e9ba..221f7cc 100644 --- a/src/node/data.js +++ b/src/node/data.js @@ -21,7 +21,7 @@ export async function* pollPublicData() { const publicDataURL = 'https://woke.net/api/streams.json' const refreshInterval = 5 * 1000 while (true) { - let data + let data = [] try { const resp = await fetch(publicDataURL) data = await resp.json()