Merge pull request #854 from vector-im/dbkr/null_check_callfeed_stream

Don't crash if no stream on callfeed
This commit is contained in:
David Baker 2023-01-17 16:52:47 +00:00 committed by GitHub
commit 62cce08142
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,