fix: replace hasattr with dictionary key check for flow_data nodes (#5668)

This commit is contained in:
Cristhian Zanforlin Lousa 2025-01-14 10:49:45 -03:00 committed by GitHub
commit 43d22fdcab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5,7 +5,7 @@ from .model import Flow
def get_webhook_component_in_flow(flow_data: dict):
"""Get webhook component in flow data."""
if hasattr(flow_data, "nodes"):
if "nodes" in flow_data:
for node in flow_data.get("nodes", []):
if "Webhook" in node.get("id"):
return node