diff --git a/plexpy/__init__.py b/plexpy/__init__.py index 5c3e211a..0585961a 100644 --- a/plexpy/__init__.py +++ b/plexpy/__init__.py @@ -1621,8 +1621,11 @@ def upgrade(): def shutdown(restart=False, update=False, checkout=False): cherrypy.engine.exit() - SCHED.shutdown(wait=False) - activity_handler.ACTIVITY_SCHED.shutdown(wait=False) + + if SCHED.running: + SCHED.shutdown(wait=False) + if activity_handler.ACTIVITY_SCHED.running: + activity_handler.ACTIVITY_SCHED.shutdown(wait=False) # Stop the notification threads for i in range(CONFIG.NOTIFICATION_THREADS):