fix: scope input-scanning loop inside per-node try/except in extract_models_from_prompt

If INPUT_TYPES() succeeded but returned a non-dict, the inner loop
calling input_types.get() would raise AttributeError outside the guard,
aborting model tracking for the entire prompt. Moving the loop inside
the try/except means only the offending node is skipped via continue.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-09 18:34:10 +02:00
parent 831ed302e9
commit 9477777124
+2 -3
View File
@@ -159,9 +159,6 @@ class ModelMapper:
try: try:
input_types = node_cls.INPUT_TYPES() input_types = node_cls.INPUT_TYPES()
except Exception:
continue
for category in ("required", "optional"): for category in ("required", "optional"):
for input_name, input_def in input_types.get(category, {}).items(): for input_name, input_def in input_types.get(category, {}).items():
if not isinstance(input_def, (list, tuple)) or not input_def: if not isinstance(input_def, (list, tuple)) or not input_def:
@@ -176,6 +173,8 @@ class ModelMapper:
if model_type: if model_type:
seen.add(value) seen.add(value)
results.append((value, model_type)) results.append((value, model_type))
except Exception:
continue
return results return results