Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"TypeError: Cannot read property '1' of null" on successful cwd #30

Closed
victorstanciu opened this issue Dec 18, 2012 · 3 comments
Closed

Comments

@victorstanciu
Copy link
Contributor

When cwd-ing into an existing directory, the following error is thrown:

TypeError: Cannot read property '1' of null

The first item of the backtrace is:

cb(undefined, /"(.+)"(?: |$)/.exec(text)[1]);

The code I am using:

var FTPClient = require('ftp');

var c = new FTPClient();

c.on('ready', function() {
    c.cwd('/directory-that-exists', function (error) {
        if (error) {
            return console.log(error);
        }
        c.list(function (error, list) {
            if (error) {
                return console.log(error);
            }

            console.dir(list);
        });
    })
});

c.connect({
    host: 'localhost',
    port: 21,
    user: 'ftp',
    password: 'ftp'
});

I've tested this on three separate servers. The only thing they have in common is that they respond to the CWD statement with:

250 CWD command successful

I can also tell you the server software running on two of them:

ProFTPD 1.3.2e
ProFTPD 1.3.4a

Otherwise, everything seems to work I can .list just fine if I don't cwd first.

@victorstanciu
Copy link
Contributor Author

In case it matters, I'm using the latest version of your repo off npm, and node -v outputs v0.8.15

@mscdex
Copy link
Owner

mscdex commented Dec 18, 2012

Should be fixed now in f9983c8. Please give it a try.

@victorstanciu
Copy link
Contributor Author

Awesome response time! It works, thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants