From 35fe857b0709dcf0cdf226e57f3065e739e2dd39 Mon Sep 17 00:00:00 2001 From: Steven Zou Date: Mon, 2 Apr 2018 11:12:20 +0800 Subject: [PATCH] Fix nil pointer issue in replication/target --- src/replication/target/target.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/replication/target/target.go b/src/replication/target/target.go index 3db7e7694..2452a0039 100644 --- a/src/replication/target/target.go +++ b/src/replication/target/target.go @@ -40,6 +40,11 @@ func (d *DefaultManager) GetTarget(id int64) (*models.RepTarget, error) { if err != nil { return nil, err } + + if target == nil { + return nil, nil + } + // decrypt the password if len(target.Password) > 0 { key, err := config.SecretKey()