mirror of
https://github.com/jech/galene.git
synced 2024-11-22 16:45: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:
parent
65637c1832
commit
50ad751e7d
1 changed files with 8 additions and 6 deletions
|
@ -56,12 +56,14 @@ Connection.prototype.close = function(sendit) {
|
||||||
while(this.timers.length > 0)
|
while(this.timers.length > 0)
|
||||||
clearInterval(this.timers.pop());
|
clearInterval(this.timers.pop());
|
||||||
|
|
||||||
|
if(this.stream) {
|
||||||
this.stream.getTracks().forEach(t => {
|
this.stream.getTracks().forEach(t => {
|
||||||
try {
|
try {
|
||||||
t.stop();
|
t.stop();
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
this.pc.close();
|
this.pc.close();
|
||||||
|
|
||||||
if(sendit) {
|
if(sendit) {
|
||||||
|
|
Loading…
Reference in a new issue