Fix error on exiting when there is no stream_server started

This commit is contained in:
shortcutme 2017-06-20 20:28:09 +02:00
parent e157894694
commit 71fbcee76c
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -35,6 +35,7 @@ class ConnectionServer:
self.ips = {} # Connection by ip
self.has_internet = True # Internet outage detection
self.stream_server = None
self.running = True
self.thread_checker = gevent.spawn(self.checkConnections)
@ -74,7 +75,8 @@ class ConnectionServer:
def stop(self):
self.running = False
self.stream_server.stop()
if self.stream_server:
self.stream_server.stop()
def handleIncomingConnection(self, sock, addr):
ip, port = addr