From 6982193722221d99bf2229e3c0dffd03ca809156 Mon Sep 17 00:00:00 2001 From: jvfe Date: Fri, 25 Oct 2024 13:45:05 -0300 Subject: [PATCH] refact: Check if content has subwfs --- nf_core/components/update.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nf_core/components/update.py b/nf_core/components/update.py index b4e719c35..5aa24acac 100644 --- a/nf_core/components/update.py +++ b/nf_core/components/update.py @@ -889,10 +889,10 @@ def get_components_to_update(self, component): for subworkflow in installed_by: if subworkflow != component: for remote_url, content in mods_json["repos"].items(): - all_subworkflows = content["subworkflows"] - for _, details in all_subworkflows.items(): - git_remote = remote_url if subworkflow in details else self.current_remote - break + if (all_subworkflows := content.get("subworkflows")) is not None: + for _, details in all_subworkflows.items(): + git_remote = remote_url if subworkflow in details else self.current_remote + break if subworkflow != self.component_type: subworkflows_to_update.append({"name": subworkflow, "git_remote": git_remote})