diff --git a/nf_core/utils.py b/nf_core/utils.py index 06fd69ebd..5120519e5 100644 --- a/nf_core/utils.py +++ b/nf_core/utils.py @@ -1139,11 +1139,7 @@ def load_tools_config(directory: Union[str, Path] = ".") -> Tuple[Optional[Path] wf_config = fetch_wf_config(Path(directory)) if nf_core_yaml_config["repository_type"] == "pipeline" and wf_config: # Retrieve information if template from config file is empty - config_template_keys = ( - tools_config["template"].keys() - if "template" in tools_config and tools_config["template"] is not None - else [] - ) + config_template_keys = tools_config.get('template', {}).keys() if nf_core_yaml_config.template is None: # The .nf-core.yml file did not contain template information nf_core_yaml_config.template = NFCoreTemplateConfig(