Skip to content

Commit

Permalink
Fix rangesearch attempting to dereference nil pointers
Browse files Browse the repository at this point in the history
  • Loading branch information
minkezhang committed Nov 15, 2021
1 parent 49013aa commit 1073983
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/rangesearch/rangesearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ import (
// Search traverses the K-D tree node and returns all child nodes which are
// contained in the bounding rectangle.
func Search(n *node.N, r hyperrectangle.R) []*node.N {
if n == nil {
return nil
}

min := make([]float64, n.P().Dimension())
max := make([]float64, n.P().Dimension())

Expand Down

0 comments on commit 1073983

Please sign in to comment.