From 40dad683d3f9d9979c18fa3d739a5b63f2e42573 Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Sun, 22 Nov 2020 01:09:18 -0500 Subject: [PATCH] Fix standalone crash due to missing apiclient --- src/scripts/autocast.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/scripts/autocast.js b/src/scripts/autocast.js index 0f3f1ed622..00f8df5abc 100644 --- a/src/scripts/autocast.js +++ b/src/scripts/autocast.js @@ -42,8 +42,12 @@ function onOpen() { }); } -const apiClient = ServerConnections.currentApiClient(); +try { + const apiClient = ServerConnections.currentApiClient(); -if (apiClient && supported()) { - Events.on(apiClient, 'websocketopen', onOpen); + if (apiClient && supported()) { + Events.on(apiClient, 'websocketopen', onOpen); + } +} catch (ex) { + console.warn('Could not get current apiClient', ex); }