Skip to content

Commit

Permalink
graffiti: ensure indexer do not return nil nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
lebauce committed Sep 26, 2019
1 parent e34aa6a commit a743de8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions graffiti/graph/indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ type Indexer struct {
func (i *NodeIndex) FromHash(hash string) (nodes []*Node, values []interface{}) {
if ids, found := i.hashToValues[hash]; found {
for id, obj := range ids {
nodes = append(nodes, i.graph.GetNode(id))
values = append(values, obj)
if node := i.graph.GetNode(id); node != nil {
nodes = append(nodes, node)
values = append(values, obj)
}
}
}
return
Expand Down

0 comments on commit a743de8

Please sign in to comment.