diff --git a/pkg/sql/colexec/colexecutils/spilling_queue.go b/pkg/sql/colexec/colexecutils/spilling_queue.go index e255af67d72c..2f14072d06f7 100644 --- a/pkg/sql/colexec/colexecutils/spilling_queue.go +++ b/pkg/sql/colexec/colexecutils/spilling_queue.go @@ -513,7 +513,7 @@ func (q *SpillingQueue) MemoryUsage() int64 { // Close closes the spilling queue. func (q *SpillingQueue) Close(ctx context.Context) error { - if q.closed { + if q == nil || q.closed { return nil } if q.diskQueue != nil {