Skip to content

Commit 989fa54

Browse files
recall704ming535
authored andcommitted
fix mysql output close panic (#244)
1 parent 683faba commit 989fa54

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

pkg/outputs/mysql/mysql.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,12 @@ func (output *MySQLOutput) Start() error {
139139
}
140140

141141
func (output *MySQLOutput) Close() {
142-
output.db.Close()
143-
output.targetSchemaStore.Close()
142+
if output.db != nil {
143+
output.db.Close()
144+
}
145+
if output.targetSchemaStore != nil {
146+
output.targetSchemaStore.Close()
147+
}
144148
}
145149

146150
func (output *MySQLOutput) GetRouter() core.Router {

0 commit comments

Comments
 (0)