Преглед изворни кода

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

Malte Kraus пре 8 година
родитељ
комит
20f16c3fa3
1 измењених фајлова са 2 додато и 1 уклоњено
  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