From 559b262db881298aeef8fce223c7de24de24fbc6 Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 18 May 2018 19:08:37 -0700 Subject: [PATCH] core: break attempts to read from a socket if no data is available --- classes.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/classes.py b/classes.py index 0ccda4c..81c2a79 100644 --- a/classes.py +++ b/classes.py @@ -1774,6 +1774,10 @@ class IRCNetwork(PyLinkNetworkCoreWithUtils): """ Message handler, called when select() has data to read. """ + if self._socket is None: + log.debug('(%s) Ignoring attempt to read data because self._socket is None', self.name) + return + data = b'' try: data = self._socket.recv(2048)