mirror of
https://github.com/pgsty/minio.git
synced 2026-07-23 22:16:15 +03: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:
@@ -312,7 +312,11 @@ func (target *MySQLTarget) Close() error {
|
||||
_ = target.insertStmt.Close()
|
||||
}
|
||||
|
||||
return target.db.Close()
|
||||
if target.db != nil {
|
||||
return target.db.Close()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Executes the table creation statements.
|
||||
|
||||
Reference in New Issue
Block a user