Skip to content

Commit 149ae3d

Browse files
committed
In case of error, get should return. Fixes #92.
1 parent eeac882 commit 149ae3d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/jsftp.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ Ftp.prototype.get = function(remotePath, localPath, callback) {
420420
callback = once(callback || NOOP);
421421
this.getGetSocket(remotePath, function(err, socket) {
422422
if (err) {
423-
callback(err);
423+
return callback(err);
424424
}
425425

426426
var writeStream = fs.createWriteStream(localPath);
@@ -436,7 +436,7 @@ Ftp.prototype.get = function(remotePath, localPath, callback) {
436436
socket.on('end', callback);
437437
socket.pipe(writeStream);
438438
socket.resume();
439-
})
439+
});
440440
}
441441
};
442442

0 commit comments

Comments
 (0)