瀏覽代碼

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.
master
Pawel Domas 4 年之前
父節點
當前提交
7c90f75ec9
共有 1 個檔案被更改,包括 2 行新增2 行删除
  1. 2
    2
      conference.js

+ 2
- 2
conference.js 查看文件

2248
                     return this.useAudioStream(stream);
2248
                     return this.useAudioStream(stream);
2249
                 })
2249
                 })
2250
                 .then(() => {
2250
                 .then(() => {
2251
-                    if (hasDefaultMicChanged) {
2251
+                    if (this.localAudio && hasDefaultMicChanged) {
2252
                         // workaround for the default device to be shown as selected in the
2252
                         // workaround for the default device to be shown as selected in the
2253
                         // settings even when the real device id was passed to gUM because of the
2253
                         // settings even when the real device id was passed to gUM because of the
2254
                         // above mentioned chrome bug.
2254
                         // above mentioned chrome bug.
2588
                                     // Use the new stream or null if we failed to obtain it.
2588
                                     // Use the new stream or null if we failed to obtain it.
2589
                                     return useStream(tracks.find(track => track.getType() === mediaType) || null)
2589
                                     return useStream(tracks.find(track => track.getType() === mediaType) || null)
2590
                                         .then(() => {
2590
                                         .then(() => {
2591
-                                            if (hasDefaultMicChanged) {
2591
+                                            if (this.localAudio && hasDefaultMicChanged) {
2592
                                                 // workaround for the default device to be shown as selected in the
2592
                                                 // workaround for the default device to be shown as selected in the
2593
                                                 // settings even when the real device id was passed to gUM because of
2593
                                                 // settings even when the real device id was passed to gUM because of
2594
                                                 // the above mentioned chrome bug.
2594
                                                 // the above mentioned chrome bug.

Loading…
取消
儲存