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.
This commit is contained in:
Pawel Domas 2021-01-27 09:15:09 -06:00 committed by Jaya Allamsetty
parent bf714c1c8b
commit 7c90f75ec9
1 changed files with 2 additions and 2 deletions

View File

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