Skip to content

Commit

Permalink
In case of error, get should return. Fixes #92.
Browse files Browse the repository at this point in the history
  • Loading branch information
sergi committed Jul 7, 2014
1 parent eeac882 commit 149ae3d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/jsftp.js
Expand Up @@ -420,7 +420,7 @@ Ftp.prototype.get = function(remotePath, localPath, callback) {
callback = once(callback || NOOP); callback = once(callback || NOOP);
this.getGetSocket(remotePath, function(err, socket) { this.getGetSocket(remotePath, function(err, socket) {
if (err) { if (err) {
callback(err); return callback(err);
} }


var writeStream = fs.createWriteStream(localPath); var writeStream = fs.createWriteStream(localPath);
Expand All @@ -436,7 +436,7 @@ Ftp.prototype.get = function(remotePath, localPath, callback) {
socket.on('end', callback); socket.on('end', callback);
socket.pipe(writeStream); socket.pipe(writeStream);
socket.resume(); socket.resume();
}) });
} }
}; };


Expand Down

0 comments on commit 149ae3d

Please sign in to comment.