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 #325

Closed
ReidandKat opened this issue Feb 6, 2015 · 5 comments
Closed

TypeError: Cannot read property '1' of null #325

ReidandKat opened this issue Feb 6, 2015 · 5 comments

Comments

@ReidandKat
Copy link

Can someone please assist me with this. I have a simple irc client that sends messages to visitors via socket.io

This error seems to happen completely randomly:

C:\Program Files\nodejs\node_modules\irc\lib\parse_message.js:39
message.command = match[1];
^
TypeError: Cannot read property '1' of null
at parseMessage (C:\Program Files\nodejs\node_modules\irc\lib\parse_message.js:39:28)
at iterator (C:\Program Files\nodejs\node_modules\irc\lib\irc.js:753:27)
at Array.forEach (native)
at Socket. (C:\Program Files\nodejs\node_modules\irc\lib\irc.js:752:15)
at Socket.emit (events.js:95:17)
at Socket. (stream_readable.js:765:14)
at Socket.emit (events.js:92:17)
at emitReadable
(_stream_readable.js:427:10)
at emitReadable (_stream_readable.js:423:5)
at readableAddChunk (_stream_readable.js:166:9)

@aivot-on
Copy link
Contributor

aivot-on commented Feb 6, 2015

It happens when server sends an empty line.
PR #318 fixed the problem for me.

@ReidandKat
Copy link
Author

When will the fix be pushed to npm?

@saltire
Copy link

saltire commented Mar 14, 2015

Second this; an NPM update would be great.

I've found this issue occurs when the server sends newlines as \r\n and the packets split up the \r and the \n. The \n gets interpreted as an empty line, causing a crash. It'd be nice to have #318 in the NPM release.

Thanks for this package, btw!

@Shilo
Copy link

Shilo commented Mar 21, 2015

+1

@Czzzzzzzzz
Copy link

I also encountered this problem today. It happened when NPM install

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

5 participants