Antonio Cheong commited on
Commit
c7d7628
·
1 Parent(s): 0795fe7

Close only if not already

Browse files
Files changed (1) hide show
  1. src/EdgeGPT.py +3 -2
src/EdgeGPT.py CHANGED
@@ -185,8 +185,9 @@ class ChatHub:
185
  """
186
  Close the connection
187
  """
188
- await self.wss.close()
189
-
 
190
 
191
  class Chatbot:
192
  """
 
185
  """
186
  Close the connection
187
  """
188
+ if self.wss:
189
+ if not self.wss.closed:
190
+ await self.wss.close()
191
 
192
  class Chatbot:
193
  """