From ad5198499167fa5fd4c0314dad9f96ef4259e934 Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Sat, 5 Oct 2024 18:41:02 +0000 Subject: [PATCH] Don't crash if there is no plugin directory --- src/sshare/config_directory.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/sshare/config_directory.py b/src/sshare/config_directory.py index 2f84532..cf45ae0 100644 --- a/src/sshare/config_directory.py +++ b/src/sshare/config_directory.py @@ -25,9 +25,12 @@ def default_config(): return _LOCATION / "config.toml" def plugins(): - return [ - path for - path in - (_LOCATION / "plugins").iterdir() - if path.is_file() and path.suffix == ".py" - ] + if (_LOCATION / "plugins").is_dir(): + return [ + path for + path in + (_LOCATION / "plugins").iterdir() + if path.is_file() and path.suffix == ".py" + ] + else: + return []