From 7c90f75ec926f71546beae292d4821caaa6fc2c8 Mon Sep 17 00:00:00 2001 From: Pawel Domas <2965063+paweldomas@users.noreply.github.com> Date: Wed, 27 Jan 2021 09:15:09 -0600 Subject: [PATCH] fix(conference.js): crash on undefined While on the prejoin screen, the local tracks are managed by the redux store and not conference.js, so localAudio is undefined. --- conference.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conference.js b/conference.js index cf0918bda..319e5980b 100644 --- a/conference.js +++ b/conference.js @@ -2248,7 +2248,7 @@ export default { return this.useAudioStream(stream); }) .then(() => { - if (hasDefaultMicChanged) { + if (this.localAudio && hasDefaultMicChanged) { // workaround for the default device to be shown as selected in the // settings even when the real device id was passed to gUM because of the // above mentioned chrome bug. @@ -2588,7 +2588,7 @@ export default { // Use the new stream or null if we failed to obtain it. return useStream(tracks.find(track => track.getType() === mediaType) || null) .then(() => { - if (hasDefaultMicChanged) { + if (this.localAudio && hasDefaultMicChanged) { // workaround for the default device to be shown as selected in the // settings even when the real device id was passed to gUM because of // the above mentioned chrome bug.