diff --git a/flow/connectors/postgres/postgres.go b/flow/connectors/postgres/postgres.go index 8e2cb13a0e..7c98a8c6ea 100644 --- a/flow/connectors/postgres/postgres.go +++ b/flow/connectors/postgres/postgres.go @@ -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() }