Skip to content

Commit 423357b

Browse files
committed
graffiti: ensure indexer do not return nil nodes
1 parent cf9752b commit 423357b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: graffiti/graph/indexer.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,10 @@ type Indexer struct {
6262
func (i *NodeIndex) FromHash(hash string) (nodes []*Node, values []interface{}) {
6363
if ids, found := i.hashToValues[hash]; found {
6464
for id, obj := range ids {
65-
nodes = append(nodes, i.graph.GetNode(id))
66-
values = append(values, obj)
65+
if node := i.graph.GetNode(id); node != nil {
66+
nodes = append(nodes, node)
67+
values = append(values, obj)
68+
}
6769
}
6870
}
6971
return

0 commit comments

Comments
 (0)