From 8284d0da60aea972209219d5082ac81f57a549bf Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 16 Jan 2023 18:10:50 +0000 Subject: [PATCH] Don't crash if no stream on callfeed --- src/video-grid/useCallFeed.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/video-grid/useCallFeed.ts b/src/video-grid/useCallFeed.ts index 35bf8e5..e29bfac 100644 --- a/src/video-grid/useCallFeed.ts +++ b/src/video-grid/useCallFeed.ts @@ -39,7 +39,10 @@ function getCallFeedState(callFeed: CallFeed | undefined): CallFeedState { videoMuted: callFeed ? callFeed.isVideoMuted() : true, audioMuted: callFeed ? callFeed.isAudioMuted() : true, localVolume: callFeed ? callFeed.getLocalVolume() : 0, - hasAudio: callFeed ? callFeed.stream.getAudioTracks().length >= 1 : false, + hasAudio: + callFeed && callFeed.stream + ? callFeed.stream.getAudioTracks().length >= 1 + : false, disposed: callFeed ? callFeed.disposed : undefined, stream: callFeed ? callFeed.stream : undefined, purpose: callFeed ? callFeed.purpose : undefined,