Do not call nil callback (#4607)
This commit is contained in:
@@ -966,7 +966,9 @@ func (p *ParticipantImpl) GetTelemetryListener() types.ParticipantTelemetryListe
|
|||||||
|
|
||||||
func (p *ParticipantImpl) AddOnClose(key string, callback func(types.LocalParticipant)) {
|
func (p *ParticipantImpl) AddOnClose(key string, callback func(types.LocalParticipant)) {
|
||||||
if p.isClosed.Load() {
|
if p.isClosed.Load() {
|
||||||
go callback(p)
|
if callback != nil {
|
||||||
|
go callback(p)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user