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 9, 2024
1 parent b73aa5f commit 7e24789
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 7e24789

Please sign in to comment.