Skip to content

Commit

Permalink
Added null checks, removed unnecessary mark check
Browse files Browse the repository at this point in the history
  • Loading branch information
bancek committed Nov 30, 2012
1 parent 76b42dc commit 1ce781f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/jsftp.js
Expand Up @@ -365,8 +365,8 @@ Ftp.getPasvPort = function(text) {
var ftpResponse = action[0];
var command = action[1];
var callback = command[1];
if (Ftp.isMark(ftpResponse.code)) {
if (callback.acceptsMarks) {
if (ftpResponse != null && Ftp.isMark(ftpResponse.code)) {
if (callback != null && callback.acceptsMarks) {
callback(null, ftpResponse);
}
this.cmdQueue.next(['', callback]);
Expand Down Expand Up @@ -602,9 +602,7 @@ Ftp.getPasvPort = function(text) {
if (err) {
doneCallback(err)
} else {
if (!Ftp.isMark(res.code)) {
doneCallback(err, res)
}
doneCallback(err, res)
}
}
}
Expand Down

0 comments on commit 1ce781f

Please sign in to comment.