Skip to content
This repository has been archived by the owner on Mar 6, 2023. It is now read-only.

Fix exception in log file on client disconnect #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion stratum/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down