Merge pull request #640 from EDCD/fix/639-crash-linux-unset-journal-dir

Dont crash when journal_dir is None
This commit is contained in:
Athanasius authored and GitHub committed 2020-07-27 18:10:34 +01:00
commit 67b295df6b
1 file changed
+9 -2
+9 -2
View File
@@ -118,9 +118,16 @@ class EDLogs(FileSystemEventHandler):
def start(self, root):
self.root = root
logdir = expanduser(config.get('journaldir') or config.default_journal_dir) # type: ignore # config is weird
journal_dir = config.get('journaldir') or config.default_journal_dir
if not logdir or not isdir(logdir): # type: ignore # config does weird things in its get
if journal_dir is None:
journal_dir = ''
# TODO(A_D): this is ignored for type checking due to all the different types config.get returns
# When that is refactored, remove the magic comment
logdir = expanduser(journal_dir) # type: ignore # config is weird
if not logdir or not isdir(logdir):
self.stop()
return False