diff --git a/pkg/adt/interval_tree.go b/pkg/adt/interval_tree.go index ab311c6d6..6edbe593f 100644 --- a/pkg/adt/interval_tree.go +++ b/pkg/adt/interval_tree.go @@ -447,6 +447,9 @@ func (ivt *IntervalTree) Contains(iv Interval) bool { // Stab returns a slice with all elements in the tree intersecting the interval. func (ivt *IntervalTree) Stab(iv Interval) (ivs []*IntervalValue) { + if ivt.count == 0 { + return nil + } f := func(n *IntervalValue) bool { ivs = append(ivs, n); return true } ivt.Visit(iv, f) return ivs