Skip to content

Commit

Permalink
Avoid calling Close on nil connection
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Feb 8, 2024
1 parent 5e47225 commit 7cdb75b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion flow/connectors/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,9 @@ func (c *PostgresConnector) replicationOptions(publicationName string) (*pglogre
// Close closes all connections.
func (c *PostgresConnector) Close() error {
if c != nil {
c.replConn.Close(c.ctx)
if c.replConn != nil {
c.replConn.Close(c.ctx)
}
c.conn.Close(c.ctx)
c.ssh.Close()
}
Expand Down

0 comments on commit 7cdb75b

Please sign in to comment.