From 88530db9e928c61a8db27e33894b7524c9853688 Mon Sep 17 00:00:00 2001 From: Max Lapan Date: Sat, 11 May 2013 16:42:31 +0400 Subject: [PATCH] Fix exception in log when client disconnects --- stratum/protocol.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stratum/protocol.py b/stratum/protocol.py index 02d9954..f56e56a 100644 --- a/stratum/protocol.py +++ b/stratum/protocol.py @@ -85,7 +85,10 @@ def transport_write(self, data): '''Overwrite this if transport needs some extra care about data written to the socket, like adding message format in websocket.''' try: - self.transport.write(data) + if self.transport != None: + self.transport.write(data) + else: + log.info ("Client disconnected") except AttributeError: # Transport is disconnected pass