1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-10 02:35:58 +01:00

Protect against stream being null in connection.close.

This may happen if we close a connection before getting any tracks.
This commit is contained in:
Juliusz Chroboczek 2020-05-30 13:15:12 +02:00
parent 65637c1832
commit 50ad751e7d

View file

@ -56,12 +56,14 @@ Connection.prototype.close = function(sendit) {
while(this.timers.length > 0)
clearInterval(this.timers.pop());
this.stream.getTracks().forEach(t => {
try {
t.stop();
} catch(e) {
}
});
if(this.stream) {
this.stream.getTracks().forEach(t => {
try {
t.stop();
} catch(e) {
}
});
}
this.pc.close();
if(sendit) {