[#2203] shard: Do not panic in Close after unsuccessful Init

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2023-01-18 14:12:35 +03:00 committed by fyrchik
parent 6efa93be0a
commit 6451f019d2

View file

@ -261,7 +261,10 @@ func (s *Shard) Close() error {
} }
} }
s.gc.stop() // If Init/Open was unsuccessful gc can be nil.
if s.gc != nil {
s.gc.stop()
}
return nil return nil
} }