1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-13 07:47:14 +03:00

monitor: journal_newest_filename(): Check for None directory

os.listdir(None) operates on '.', which is wrong in this context, so be
sure to avoid that.
This commit is contained in:
Athanasius 2022-03-18 09:49:02 +00:00
parent 4b12a6c484
commit c89548c2ba
No known key found for this signature in database
GPG Key ID: AE3E527847057C7D

View File

@ -268,6 +268,10 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below
:param journals_dir: The directory to check
:return: The `str` form of the full path to the newest Journal file
"""
# os.listdir(None) returns CWD's contents
if journals_dir is None:
return None
journal_files = (x for x in listdir(journals_dir) if self._RE_LOGFILE.search(x))
if journal_files:
# Odyssey Update 11 has, e.g. Journal.2022-03-15T152503.01.log