From f5a9b82286070b19f8da1670b8a5ad80e799fccb Mon Sep 17 00:00:00 2001 From: Stephen Knox Date: Tue, 25 Aug 2026 12:54:55 +0000 Subject: [PATCH] Fix crash when a template type has zero typeattrs A templatetype with no typeattrs serialises its `typeattrs` as None rather than an empty list. _bulk_add_resource_attrs stored that None directly into typeattr_lookup, and the later `.get(resource_type.id, [])` fallback never applies (the key exists, just mapped to None), so `for ta in typeattrs` crashes with a TypeError on any node/link whose type has no attributes at all (e.g. a plain junction). --- hydra_base/lib/network.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hydra_base/lib/network.py b/hydra_base/lib/network.py index 7566a358..73db8817 100644 --- a/hydra_base/lib/network.py +++ b/hydra_base/lib/network.py @@ -264,7 +264,7 @@ def _bulk_add_resource_attrs(network_id, ref_key, resources, resource_name_map, template_j = template.get_template(resource_type.child_template_id, user_id=admin_id) template_lookup[template_j.id] = template_j for tt in template_j.templatetypes: - typeattr_lookup[tt.id] = tt.typeattrs + typeattr_lookup[tt.id] = tt.typeattrs or [] typeattrs = typeattr_lookup.get(resource_type.id, []) #TODO this should be type_id for ta in typeattrs: