diff --git a/pkg/outputs/mysql/mysql.go b/pkg/outputs/mysql/mysql.go index c13a2b64..21c2a9bf 100644 --- a/pkg/outputs/mysql/mysql.go +++ b/pkg/outputs/mysql/mysql.go @@ -131,8 +131,12 @@ func (output *MySQLOutput) Start() error { } func (output *MySQLOutput) Close() { - output.db.Close() - output.targetSchemaStore.Close() + if output.db != nil { + output.db.Close() + } + if output.targetSchemaStore != nil { + output.targetSchemaStore.Close() + } } func (output *MySQLOutput) GetRouter() core.Router {