Fix nil pointer issue in replication/target

This commit is contained in:
Steven Zou 2018-04-02 11:12:20 +08:00
parent 0dd595ca63
commit 35fe857b07

View File

@ -40,6 +40,11 @@ func (d *DefaultManager) GetTarget(id int64) (*models.RepTarget, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
if target == nil {
return nil, nil
}
// decrypt the password // decrypt the password
if len(target.Password) > 0 { if len(target.Password) > 0 {
key, err := config.SecretKey() key, err := config.SecretKey()