From 8a0a82fe43cc34853ba7e287915c86010b332c25 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Fri, 8 Jan 2021 14:28:10 +0000 Subject: [PATCH] monitor: Bail from get_entry() if self.thread is None If there's no thread to have sent the message then we shouldn't care about it as this means we're in shutdown. --- monitor.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/monitor.py b/monitor.py index b86a8590..792d2a77 100644 --- a/monitor.py +++ b/monitor.py @@ -828,6 +828,10 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below :return: dict representing the event """ + if self.thread is None: + logger.debug('Called whilst self.thread is None, returning') + return None + if not self.event_queue: logger.debug('Called with no event_queue') return None