瀏覽代碼

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
     const selectedAudioInputDeviceId = getUserSelectedMicDeviceId(APP.store.getState());
62
     const selectedAudioInputDeviceId = getUserSelectedMicDeviceId(APP.store.getState());
63
     const selectedAudioInputDevice = availableAudioInputDevices.find(
63
     const selectedAudioInputDevice = availableAudioInputDevices.find(
64
         d => d.deviceId === selectedAudioInputDeviceId);
64
         d => d.deviceId === selectedAudioInputDeviceId);
65
-    const localAudioDeviceId = localAudio.getDeviceId();
65
+    const localAudioDeviceId = localAudio?.getDeviceId();
66
     const localAudioDevice = availableAudioInputDevices.find(
66
     const localAudioDevice = availableAudioInputDevices.find(
67
         d => d.deviceId === localAudioDeviceId);
67
         d => d.deviceId === localAudioDeviceId);
68
 
68
 
114
     const selectedVideoInputDeviceId = getUserSelectedCameraDeviceId(APP.store.getState());
114
     const selectedVideoInputDeviceId = getUserSelectedCameraDeviceId(APP.store.getState());
115
     const selectedVideoInputDevice = availableVideoInputDevices.find(
115
     const selectedVideoInputDevice = availableVideoInputDevices.find(
116
         d => d.deviceId === selectedVideoInputDeviceId);
116
         d => d.deviceId === selectedVideoInputDeviceId);
117
-    const localVideoDeviceId = localVideo.getDeviceId();
117
+    const localVideoDeviceId = localVideo?.getDeviceId();
118
     const localVideoDevice = availableVideoInputDevices.find(
118
     const localVideoDevice = availableVideoInputDevices.find(
119
         d => d.deviceId === localVideoDeviceId);
119
         d => d.deviceId === localVideoDeviceId);
120
 
120
 

Loading…
取消
儲存