Double-check if self._thread != None on stop on the ntfy thread

Race conditions may occur here
This commit is contained in:
Fabio Manganiello 2023-01-27 22:12:34 +01:00
parent 341e749d23
commit 0e56d0fff6
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -110,7 +110,7 @@ class RunnablePlugin(Plugin):
try:
if self._thread:
self._thread.join(timeout=self._stop_timeout)
if self._thread.is_alive():
if self._thread and self._thread.is_alive():
self.logger.warning(
f'Timeout (seconds={self._stop_timeout}) on '
'exit for the plugin '