diff --git a/lib/ssh-client.js b/lib/ssh-client.js index 6e52c26..190774f 100644 --- a/lib/ssh-client.js +++ b/lib/ssh-client.js @@ -43,6 +43,7 @@ class SSHClient { this.client.sftp((error, sftp) => { if (error) { reject(error); + return; } let stream = sftp.createWriteStream(path); @@ -60,6 +61,7 @@ class SSHClient { this.client.sftp((error, sftp) => { if (error) { reject(error); + return; } sftp.readFile(path, { }, function(error, data) { @@ -78,6 +80,7 @@ class SSHClient { this.client.exec(command, (err/*, stream*/) => { if (err) { reject(err); + return; } resolve(); }); @@ -95,11 +98,13 @@ class SSHClient { this.client.sftp(function (err, sftp) { if (err) { reject(err); + return; } sftp.fastPut(src, dest, {}, function (err) { if (err) { reject(err); + return; } resolve(); });