fix(devices): Fixes a JS error when no audio/video is selected and there is a device update.

This commit is contained in:
Jaya Allamsetty 2021-11-10 13:04:54 -05:00 committed by Jaya Allamsetty
parent 957bd8916a
commit 9ca0ee41b6
1 changed files with 2 additions and 2 deletions

View File

@ -62,7 +62,7 @@ function getNewAudioInputDevice(newDevices, localAudio, newLabel) {
const selectedAudioInputDeviceId = getUserSelectedMicDeviceId(APP.store.getState());
const selectedAudioInputDevice = availableAudioInputDevices.find(
d => d.deviceId === selectedAudioInputDeviceId);
const localAudioDeviceId = localAudio.getDeviceId();
const localAudioDeviceId = localAudio?.getDeviceId();
const localAudioDevice = availableAudioInputDevices.find(
d => d.deviceId === localAudioDeviceId);
@ -114,7 +114,7 @@ function getNewVideoInputDevice(newDevices, localVideo, newLabel) {
const selectedVideoInputDeviceId = getUserSelectedCameraDeviceId(APP.store.getState());
const selectedVideoInputDevice = availableVideoInputDevices.find(
d => d.deviceId === selectedVideoInputDeviceId);
const localVideoDeviceId = localVideo.getDeviceId();
const localVideoDeviceId = localVideo?.getDeviceId();
const localVideoDevice = availableVideoInputDevices.find(
d => d.deviceId === localVideoDeviceId);