grpc-proxy: fix NPE
@@ -214,14 +214,10 @@ func getBackupTarget(controllerID string, backupTarget *longhorn.BackupTarget, d
if err != nil {
return nil, nil, err
}
- defer func() {
- if err != nil {
- engineClientProxy.Close()
- }
- }()
backupTargetClient, err = getBackupTargetClient(ds, backupTarget)
if err != nil {
+ engineClientProxy.Close()
return nil, nil, err
}
