mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-15 00:30:33 +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:
parent
4b12a6c484
commit
c89548c2ba
@ -268,6 +268,10 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below
|
|||||||
:param journals_dir: The directory to check
|
:param journals_dir: The directory to check
|
||||||
:return: The `str` form of the full path to the newest Journal file
|
: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))
|
journal_files = (x for x in listdir(journals_dir) if self._RE_LOGFILE.search(x))
|
||||||
if journal_files:
|
if journal_files:
|
||||||
# Odyssey Update 11 has, e.g. Journal.2022-03-15T152503.01.log
|
# Odyssey Update 11 has, e.g. Journal.2022-03-15T152503.01.log
|
||||||
|
Loading…
x
Reference in New Issue
Block a user