Skip to content
Browse files

Added null checks, removed unnecessary mark check

  • Loading branch information...
1 parent 76b42dc commit 1ce781fadeaf53ccb87c429febce54a42bc686b2 @bancek bancek committed Nov 30, 2012
Showing with 3 additions and 5 deletions.
  1. +3 −5 lib/jsftp.js
View
8 lib/jsftp.js
@@ -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]);
@@ -602,9 +602,7 @@ Ftp.getPasvPort = function(text) {
if (err) {
doneCallback(err)
} else {
- if (!Ftp.isMark(res.code)) {
- doneCallback(err, res)
- }
+ doneCallback(err, res)
}
}
}

0 comments on commit 1ce781f

Please sign in to comment.
Something went wrong with that request. Please try again.