From b03801d155c617f6b14cff592cc83b19ecb9f63b Mon Sep 17 00:00:00 2001 From: meejah Date: Fri, 12 Feb 2021 20:52:14 -0700 Subject: [PATCH] guard --- src/wormhole_transit_relay/transit_server.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/wormhole_transit_relay/transit_server.py b/src/wormhole_transit_relay/transit_server.py index 18f3b6d..4c71616 100644 --- a/src/wormhole_transit_relay/transit_server.py +++ b/src/wormhole_transit_relay/transit_server.py @@ -52,9 +52,10 @@ class TransitConnection(LineReceiver): """ ITransitClient API """ - print("buddy_disconnected {}".format(self._buddy.get_token())) - self._buddy._client.transport.loseConnection() - self._buddy = None + if self._buddy is not None: + # print("buddy_disconnected {}".format(self._buddy.get_token())) + self._buddy._client.transport.loseConnection() + self._buddy = None def describeToken(self): d = "-"