Skip to content

Commit c78ae89

Browse files
authored
Merge pull request #9 from mfeckie/bugfix/local-compare
Make name localCompare a safer operation
2 parents d626ffe + 94732ee commit c78ae89

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/utils/d3-flame-graphs-v4/d3-flame-graph.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ const FlameGraphUtils = {
8484
if (b.filler) {
8585
return -1; // move fillers to the right
8686
}
87-
return a.data.name.localeCompare(b.data.name);
87+
const name = a.data.name || "";
88+
return name.localeCompare(b.data.name);
8889
});
8990
return d3partition(root).descendants();
9091
},

0 commit comments

Comments
 (0)