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

Fix a crash bug when a zero length message is received #165

Merged

Conversation

shiwano
Copy link
Contributor

@shiwano shiwano commented May 7, 2013

Hello.

When a zero-length PRIVMSG / NOTICE message is sent to an channel that a node-irc bot is present in, it crashes with the following backtrace:

/home/shiwano/projects/lo_Ol/node_modules/hubot-irc/node_modules/irc/lib/irc.js:637
                    throw err;
                          ^
TypeError: Cannot read property '0' of undefined
  at Client.<anonymous> (/home/shiwano/projects/lo_Ol/node_modules/hubot-irc/node_modules/irc/lib/irc.js:468:25)
  at Client.EventEmitter.emit (events.js:95:17)
  at /home/shiwano/projects/lo_Ol/node_modules/hubot-irc/node_modules/irc/lib/irc.js:634:22
  at Array.forEach (native)
  at CleartextStream.<anonymous> (/home/shiwano/projects/lo_Ol/node_modules/hubot-irc/node_modules/irc/lib/irc.js:631:15)
  at CleartextStream.EventEmitter.emit (events.js:95:17)
  at CleartextStream.<anonymous> (_stream_readable.js:720:14)
  at CleartextStream.EventEmitter.emit (events.js:92:17)
  at emitReadable_ (_stream_readable.js:392:10)
  at _stream_readable.js:385:7
  at process._tickCallback (node.js:415:13)

I fixed it. Could you review it? Thanks.

@martynsmith
Copy link
Owner

This looks reasonable to me :-)

martynsmith added a commit that referenced this pull request Sep 6, 2013
Fix a crash bug when a zero length message is received
@martynsmith martynsmith merged commit ad044c3 into martynsmith:master Sep 6, 2013
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

Successfully merging this pull request may close these issues.

2 participants