diff --git a/src/wormhole/wormhole.py b/src/wormhole/wormhole.py index 2ae41dd..14658cb 100644 --- a/src/wormhole/wormhole.py +++ b/src/wormhole/wormhole.py @@ -371,7 +371,8 @@ class _Wormhole: def _event_connected(self, ws): self._ws = ws - self._ws_t.finish() + if self._ws_t: + self._ws_t.finish() def _event_ws_opened(self, _): self._connection_state = OPEN