From 7cdb75b7292c7fb0de894790f2b7b55f6c371109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Thu, 8 Feb 2024 15:20:05 +0000 Subject: [PATCH] Avoid calling Close on nil connection --- flow/connectors/postgres/postgres.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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() }