Fix rare error with ws.close()
This commit is contained in:
+8
-4
@@ -551,12 +551,16 @@ export class VideoRTC extends HTMLElement {
|
|||||||
this.pcState = WebSocket.OPEN;
|
this.pcState = WebSocket.OPEN;
|
||||||
|
|
||||||
this.wsState = WebSocket.CLOSED;
|
this.wsState = WebSocket.CLOSED;
|
||||||
this.ws.close();
|
if (this.ws) {
|
||||||
this.ws = null;
|
this.ws.close();
|
||||||
|
this.ws = null;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.pcState = WebSocket.CLOSED;
|
this.pcState = WebSocket.CLOSED;
|
||||||
this.pc.close();
|
if (this.pc) {
|
||||||
this.pc = null;
|
this.pc.close();
|
||||||
|
this.pc = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user