瀏覽代碼

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

master
Jaya Allamsetty 3 年之前
父節點
當前提交
9ca0ee41b6
共有 1 個檔案被更改,包括 2 行新增2 行删除
  1. 2
    2
      modules/devices/mediaDeviceHelper.js

+ 2
- 2
modules/devices/mediaDeviceHelper.js 查看文件

@@ -62,7 +62,7 @@ function getNewAudioInputDevice(newDevices, localAudio, newLabel) {
62 62
     const selectedAudioInputDeviceId = getUserSelectedMicDeviceId(APP.store.getState());
63 63
     const selectedAudioInputDevice = availableAudioInputDevices.find(
64 64
         d => d.deviceId === selectedAudioInputDeviceId);
65
-    const localAudioDeviceId = localAudio.getDeviceId();
65
+    const localAudioDeviceId = localAudio?.getDeviceId();
66 66
     const localAudioDevice = availableAudioInputDevices.find(
67 67
         d => d.deviceId === localAudioDeviceId);
68 68
 
@@ -114,7 +114,7 @@ function getNewVideoInputDevice(newDevices, localVideo, newLabel) {
114 114
     const selectedVideoInputDeviceId = getUserSelectedCameraDeviceId(APP.store.getState());
115 115
     const selectedVideoInputDevice = availableVideoInputDevices.find(
116 116
         d => d.deviceId === selectedVideoInputDeviceId);
117
-    const localVideoDeviceId = localVideo.getDeviceId();
117
+    const localVideoDeviceId = localVideo?.getDeviceId();
118 118
     const localVideoDevice = availableVideoInputDevices.find(
119 119
         d => d.deviceId === localVideoDeviceId);
120 120
 

Loading…
取消
儲存