Skip to content

Commit

Permalink
Improve error detection for non-streaming directory listing
Browse files Browse the repository at this point in the history
  • Loading branch information
mscdex committed Aug 2, 2012
1 parent 7d7f136 commit b3e84a6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ftp.js
Expand Up @@ -408,9 +408,12 @@ FTP.prototype.list = function(path, streaming, cb) {
emitter.on('raw', function(line) {
entries.push(line);
});
emitter.on('end', function() {
emitter.on('success', function() {
cb(undefined, entries);
});
emitter.on('error', function(err) {
cb(err);
});
} else
cb(undefined, emitter);
} else
Expand Down

0 comments on commit b3e84a6

Please sign in to comment.