Merge pull request #2097 from thornbill/fix-standalone-crash

Fix standalone crash due to missing apiclient
This commit is contained in:
Bill Thornton 2020-11-22 02:00:36 -05:00 committed by GitHub
commit 861845bba5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
}