mirror of
https://github.com/minio/minio.git
synced 2025-11-08 21:24:55 -05:00
fix: a possible crash in event target Close() (#17948)
these are possible crashes when the configured target is still in init() state and never finished - however a delete config was initiated.
This commit is contained in:
@@ -219,7 +219,9 @@ func (target *MQTTTarget) Save(eventData event.Event) error {
|
||||
|
||||
// Close - does nothing and available for interface compatibility.
|
||||
func (target *MQTTTarget) Close() error {
|
||||
target.client.Disconnect(100)
|
||||
if target.client != nil {
|
||||
target.client.Disconnect(100)
|
||||
}
|
||||
close(target.quitCh)
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user