fix close on nil sink (#344)

This commit is contained in:
cnderrauber
2022-01-17 12:04:01 +08:00
committed by GitHub
parent c122c98e4d
commit 629dae0f84

View File

@@ -464,7 +464,9 @@ func (p *ParticipantImpl) Close(sendLeave bool) error {
// ensure this is synchronized
p.lock.RLock()
p.params.Sink.Close()
if p.params.Sink != nil {
p.params.Sink.Close()
}
onClose := p.onClose
p.lock.RUnlock()
if onClose != nil {