Kaynağa Gözat

protocol: only try to close a peer connection when there is a peer

Malte Kraus 8 yıl önce
ebeveyn
işleme
20f16c3fa3
1 değiştirilmiş dosya ile 2 ekleme ve 1 silme
  1. 2 1
      src/protocol.py

+ 2 - 1
src/protocol.py

@@ -278,7 +278,8 @@ class Protocol:
             except:
                 logging.exception("unhandled exception in event handler")
                 try:
-                    peer.close()
+                    if peer is not None:
+                        peer.close()
                 except OSError:
                     pass