diff --git a/worker/sort.go b/worker/sort.go index 6cbd0e7e7ee..10a62830608 100644 --- a/worker/sort.go +++ b/worker/sort.go @@ -327,7 +327,9 @@ BUCKETS: // Apply the offset on null nodes, if the nodes with value were not enough. if out[i].offset < len(nullNodes) { - nullNodes = nullNodes[out[i].offset:] + if out[i].offset >= 0 { + nullNodes = nullNodes[out[i].offset:] + } } else { nullNodes = nullNodes[:0] }