Permalink
Browse files

In case of error, `get` should return. Fixes #92.

  • Loading branch information...
1 parent eeac882 commit 149ae3daa67a6d10875190debba8e35480e286ff @sergi committed Jul 7, 2014
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/jsftp.js
View
4 lib/jsftp.js
@@ -420,7 +420,7 @@ Ftp.prototype.get = function(remotePath, localPath, callback) {
callback = once(callback || NOOP);
this.getGetSocket(remotePath, function(err, socket) {
if (err) {
- callback(err);
+ return callback(err);
}
var writeStream = fs.createWriteStream(localPath);
@@ -436,7 +436,7 @@ Ftp.prototype.get = function(remotePath, localPath, callback) {
socket.on('end', callback);
socket.pipe(writeStream);
socket.resume();
- })
+ });
}
};

0 comments on commit 149ae3d

Please sign in to comment.