diff --git a/query/common_test.go b/query/common_test.go index 56512d63bcf..028ae382351 100644 --- a/query/common_test.go +++ b/query/common_test.go @@ -468,6 +468,7 @@ func populateCluster() { <36> "CA" . <1> "123456" . + <32> "123456" . <23> "654321" . <23> "4" . diff --git a/query/recurse.go b/query/recurse.go index cd4861c3bd2..ad83fe00e56 100644 --- a/query/recurse.go +++ b/query/recurse.go @@ -94,6 +94,11 @@ func (start *SubGraph) expandRecurse(ctx context.Context, maxDepth uint64) error } for _, sg := range exec { + // sg.uidMatrix can be empty. Continue if that is the case. + if len(sg.uidMatrix) == 0 { + continue + } + if sg.UnknownAttr { continue }