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

With stripColors: true set, a post only containing control characters, such as color or bold crashes the library #218

Closed
flare561 opened this issue Jan 11, 2014 · 2 comments

Comments

@flare561
Copy link

var irc = new (require('irc')).Client('irc.testserver.com', 'test', {
... channels: ['#test'], stripColors: true
... });
undefined

test client joins IRC, another user sends a message containing only a color code, with no other text

/home/user/node_modules/irc/lib/irc.js:637
throw err;
^
TypeError: Cannot read property '0' of undefined
at Client. (/home/user/node_modules/irc/lib/irc.js:468:25)
at Client.EventEmitter.emit (events.js:95:17)
at /home/user/node_modules/irc/lib/irc.js:634:22
at Array.forEach (native)
at Socket. (/home/user/node_modules/irc/lib/irc.js:631:15)
at Socket.EventEmitter.emit (events.js:95:17)
at Socket. (stream_readable.js:746:14)
at Socket.EventEmitter.emit (events.js:92:17)
at emitReadable
(_stream_readable.js:408:10)
at emitReadable (_stream_readable.js:404:5)

test client crashes

@osslate
Copy link
Collaborator

osslate commented May 29, 2014

This doesn't appear to be an issue with colours judging by the stack trace. Took a quick look at this myself and couldn't reproduce it; closing. Feel free to update this issue with any other details if you're still having a problem.

@osslate osslate closed this as completed May 29, 2014
@webcracy
Copy link

I'm also experiencing this same error but I can't pinpoint the reasons or the circumstances.

I haven't set stripColors: true, it's a "standard" connection.

It's very hard to reproduce as it only happens 2-3 times in 35,000 messages received.

/Users/user/project/node_modules/irc/lib/irc.js:637
                    throw err;
                          ^
TypeError: Cannot read property '0' of undefined
    at Client.<anonymous> /Users/user/project/node_modules/irc/lib/irc.js:468:25)
    at Client.emit (events.js:107:17)
    at /Users/user/project/node_modules/irc/lib/irc.js:634:22
    at Array.forEach (native)
    at Socket.<anonymous> (/Users/user/project/node_modules/irc/lib/irc.js:631:15)
    at Socket.emit (events.js:107:17)
    at readableAddChunk (_stream_readable.js:163:16)
    at Socket.Readable.push (_stream_readable.js:126:10)
    at TCP.onread (net.js:538:20)

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

3 participants