summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2022-06-20 11:50:06 +0200
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2022-06-20 18:38:03 +0200
commitaf503bc6a151d9a4a29ea3df12fc7dbb8b54874a (patch)
tree81c1e808060b8eba42ffc81f41d24d93be356523 /docs
parent0640c372a8509b9c818bce17290116521e354e7d (diff)
Guard against null streams
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/Talkbuchet.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/Talkbuchet.js b/docs/Talkbuchet.js
index e1a072e41..c3e4646b4 100644
--- a/docs/Talkbuchet.js
+++ b/docs/Talkbuchet.js
@@ -682,7 +682,7 @@ const closeConnections = function() {
}
const setAudioEnabled = function(enabled) {
- if (!stream.getAudioTracks().length) {
+ if (!stream || !stream.getAudioTracks().length) {
console.error('Audio was not initialized')
return
@@ -693,7 +693,7 @@ const setAudioEnabled = function(enabled) {
}
const setVideoEnabled = function(enabled) {
- if (!stream.getVideoTracks().length) {
+ if (!stream || !stream.getVideoTracks().length) {
console.error('Video was not initialized')
return
@@ -704,7 +704,7 @@ const setVideoEnabled = function(enabled) {
}
const setSentAudioStreamEnabled = function(enabled) {
- if (!stream.getAudioTracks().length) {
+ if (!stream || !stream.getAudioTracks().length) {
console.error('Audio was not initialized')
return
@@ -723,7 +723,7 @@ const setSentAudioStreamEnabled = function(enabled) {
}
const setSentVideoStreamEnabled = function(enabled) {
- if (!stream.getVideoTracks().length) {
+ if (!stream || !stream.getVideoTracks().length) {
console.error('Video was not initialized')
return