From 426b3288043a45d46582390f9cf8293bafef2da4 Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Mon, 21 Dec 2020 17:51:51 +0100 Subject: [PATCH] Fixed a small crash --- shared/js/stats.ts | 3 ++- shared/js/ui/frames/side/ChannelDescriptionController.ts | 2 +- shared/js/ui/frames/video/Renderer.tsx | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/shared/js/stats.ts b/shared/js/stats.ts index b0147876..be501397 100644 --- a/shared/js/stats.ts +++ b/shared/js/stats.ts @@ -102,8 +102,9 @@ namespace connection { connection_state = ConnectionState.CONNECTING; connection = new WebSocket('wss://web-stats.teaspeak.de:27790'); - if(!connection) + if(!connection) { connection = new WebSocket('wss://localhost:27788'); + } { const connection_copy = connection; diff --git a/shared/js/ui/frames/side/ChannelDescriptionController.ts b/shared/js/ui/frames/side/ChannelDescriptionController.ts index eb12436f..4048eed2 100644 --- a/shared/js/ui/frames/side/ChannelDescriptionController.ts +++ b/shared/js/ui/frames/side/ChannelDescriptionController.ts @@ -92,7 +92,7 @@ export class ChannelDescriptionController { this.cachedDescriptionStatus = { status: "success", description: description, - handlerId: this.currentChannel.channelTree.client.handlerId + handlerId: this.currentChannel?.channelTree.client.handlerId || "unknown" }; } catch (error) { if(error instanceof CommandResult) { diff --git a/shared/js/ui/frames/video/Renderer.tsx b/shared/js/ui/frames/video/Renderer.tsx index 587d03b8..1647e9da 100644 --- a/shared/js/ui/frames/video/Renderer.tsx +++ b/shared/js/ui/frames/video/Renderer.tsx @@ -653,5 +653,5 @@ export const ChannelVideoRenderer = (props: { handlerId: string, events: Registr - ) + ); }; \ No newline at end of file