Skip to content

Commit

Permalink
Avoid crash on degenerate test case
Browse files Browse the repository at this point in the history
  • Loading branch information
bboreham committed May 6, 2021
1 parent 4228c28 commit 87e8afc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions controllers/events/mocks_for_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ func (f *fakeExporter) sort() {
topSpan = i
}
}
if topSpan == -1 { // no top span found; can't do DFS
return
}

sortedSpans := make([]*tracesdk.SpanSnapshot, 0, len(f.SpanSnapshot))
t := dfs{
Expand Down

0 comments on commit 87e8afc

Please sign in to comment.