diff --git a/core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js b/core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js index b8d3a034ac512..eb9cf50055cb7 100644 --- a/core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js +++ b/core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js @@ -334,11 +334,13 @@ function drawCrossStageEdges(edges, svgContainer) { } // Now draw the arrows by borrowing the arrow marker generated by dagre-d3 var dagreD3Marker = svgContainer.select("g.edgePaths marker").node(); - svgContainer - .append(function() { return dagreD3Marker.cloneNode(true); }) - .attr("id", "marker-arrow") - svgContainer.selectAll("g > path").attr("marker-end", "url(#marker-arrow)"); - svgContainer.selectAll("g.edgePaths def").remove(); // We no longer need these + if (!dagreD3Marker.empty()) { + svgContainer + .append(function() { return dagreD3Marker.cloneNode(true); }) + .attr("id", "marker-arrow") + svgContainer.selectAll("g > path").attr("marker-end", "url(#marker-arrow)"); + svgContainer.selectAll("g.edgePaths def").remove(); // We no longer need these + } } /*