mirror of
https://github.com/minio/minio.git
synced 2025-11-20 18:06:10 -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:
@@ -308,7 +308,11 @@ func (target *PostgreSQLTarget) Close() error {
|
||||
_ = target.insertStmt.Close()
|
||||
}
|
||||
|
||||
return target.db.Close()
|
||||
if target.db != nil {
|
||||
target.db.Close()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Executes the table creation statements.
|
||||
|
||||
Reference in New Issue
Block a user