From d3a44d5f0ac01c33b492ef05286fc52ed09fe380 Mon Sep 17 00:00:00 2001 From: Marks Polakovs Date: Tue, 7 Apr 2020 11:45:00 +0200 Subject: [PATCH] server: fix some bugs lol --- server.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server.py b/server.py index e8a6b6a..a111e86 100644 --- a/server.py +++ b/server.py @@ -109,10 +109,12 @@ class Session(object): print(self.connection_id, "going away") if self.sender is not None: self.sender.end() - await self.pc.close() + if self.pc is not None: + await self.pc.close() init_buffers() write_ob_status(False) - await self.websocket.send(json.dumps({"kind": "REPLACED"})) + if self.websocket is not None: + await self.websocket.send(json.dumps({"kind": "REPLACED"})) def create_peerconnection(self): self.pc = RTCPeerConnection() @@ -166,7 +168,7 @@ class Session(object): answer = await self.pc.createAnswer() await self.pc.setLocalDescription(answer) - await websocket.send( + await self.websocket.send( json.dumps( { "kind": "ANSWER",