From 423357b516bde46a702fbf6669624cc0ac003182 Mon Sep 17 00:00:00 2001 From: Sylvain Baubeau Date: Fri, 20 Sep 2019 10:05:49 +0200 Subject: [PATCH] graffiti: ensure indexer do not return nil nodes --- graffiti/graph/indexer.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/graffiti/graph/indexer.go b/graffiti/graph/indexer.go index ca704c5483..2219e37a8f 100644 --- a/graffiti/graph/indexer.go +++ b/graffiti/graph/indexer.go @@ -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