diff --git a/service.py b/service.py index 7075b105..5844cb99 100644 --- a/service.py +++ b/service.py @@ -63,10 +63,13 @@ class ServiceManager(threading.Thread): service.service() except Exception as error: - if not 'ExitService' in error and service is not None: - service.shutdown() - elif 'RestartService' in error: - service.reload_objects() + if service is not None: + + if not 'ExitService' in error: + service.shutdown() + + if 'RestartService' in error: + service.reload_objects() self.exception = error