diff --git a/airflow/www/static/js/graph.js b/airflow/www/static/js/graph.js index daf83dc0cc9b8..d12450d2b9a81 100644 --- a/airflow/www/static/js/graph.js +++ b/airflow/www/static/js/graph.js @@ -633,7 +633,7 @@ function expandGroup(nodeId, node) { edges.forEach((edge) => { const sourceId = mapTaskToNode.get(edge.source_id); const targetId = mapTaskToNode.get(edge.target_id); - if (sourceId !== targetId && !g.hasEdge(sourceId, targetId)) { + if (sourceId !== targetId && !g.hasEdge(sourceId, targetId) && sourceId && targetId) { g.setEdge(sourceId, targetId, { curve: d3.curveBasis, arrowheadClass: 'arrowhead',