From f1e19f0712ff0a82c0cd25c7bcce14b36fc03ee2 Mon Sep 17 00:00:00 2001 From: Alex Sharov Date: Thu, 1 Jun 2023 16:00:00 +0700 Subject: [PATCH] etl: collector.close nil ptr fix (#1003) --- etl/collector.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/etl/collector.go b/etl/collector.go index 9a0718f7b..e33a05f7d 100644 --- a/etl/collector.go +++ b/etl/collector.go @@ -239,10 +239,12 @@ func (c *Collector) Load(db kv.RwTx, toBucket string, loadFunc LoadFunc, args Tr } func (c *Collector) reset() { - for _, p := range c.dataProviders { - p.Dispose() + if c.dataProviders != nil { + for _, p := range c.dataProviders { + p.Dispose() + } + c.dataProviders = nil } - c.dataProviders = nil c.buf.Reset() c.allFlushed = false }