Update api/dify_graph/nodes/loop/loop_node.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
盐粒 Yanli 2026-03-25 19:29:05 +08:00 committed by GitHub
parent 7b76fdc1d3
commit bc82676d93
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -410,6 +410,9 @@ class LoopNode(LLMUsageTrackingMixin, Node[LoopNodeData]):
# configs still serialize array constants as JSON strings.
if isinstance(original_value, str):
value = json.loads(original_value) if original_value else []
elif original_value is None:
# Preserve legacy behavior: treat missing/empty array constants as [].
value = []
else:
value = original_value
else: