Skip to content

Commit ace6c9e

Browse files
authored
Merge pull request #1411 from 3clyp50/ready
fix: guard against missing plugin directory in config loads
2 parents bc274e5 + 1cccb68 commit ace6c9e

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

helpers/plugins.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -607,9 +607,10 @@ def get_plugin_config(
607607

608608
# use default config if not found
609609
if not file_path:
610-
file_path = files.get_abs_path(
611-
find_plugin_dir(plugin_name), CONFIG_DEFAULT_FILE_NAME
612-
)
610+
plugin_dir = find_plugin_dir(plugin_name)
611+
if not plugin_dir:
612+
return None
613+
file_path = files.get_abs_path(plugin_dir, CONFIG_DEFAULT_FILE_NAME)
613614
default_used = True
614615

615616
result = None
@@ -635,9 +636,11 @@ def get_plugin_config(
635636

636637

637638
def get_default_plugin_config(plugin_name: str):
638-
file_path = files.get_abs_path(
639-
find_plugin_dir(plugin_name), CONFIG_DEFAULT_FILE_NAME
640-
)
639+
plugin_dir = find_plugin_dir(plugin_name)
640+
if not plugin_dir:
641+
return None
642+
643+
file_path = files.get_abs_path(plugin_dir, CONFIG_DEFAULT_FILE_NAME)
641644

642645
# call plugin hook to get the result
643646
result = call_plugin_hook(

0 commit comments

Comments
 (0)