Skip to content

Commit

Permalink
Merge pull request #165 from shiwano/fix-zero-length-message-error
Browse files Browse the repository at this point in the history
Fix a crash bug when a zero length message is received
  • Loading branch information
martynsmith committed Sep 6, 2013
2 parents 83d42a3 + 12663fd commit ad044c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/irc.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ function Client(server, nick, opt) {
if (!to) {
to = null;
}
var text = message.args[1];
var text = message.args[1] || '';
if (text[0] === '\1' && text.lastIndexOf('\1') > 0) {
self._handleCTCP(from, to, text, 'notice', message);
break;
Expand Down Expand Up @@ -464,7 +464,7 @@ function Client(server, nick, opt) {
case "PRIVMSG":
var from = message.nick;
var to = message.args[0];
var text = message.args[1];
var text = message.args[1] || '';
if (text[0] === '\1' && text.lastIndexOf('\1') > 0) {
self._handleCTCP(from, to, text, 'privmsg', message);
break;
Expand Down

0 comments on commit ad044c3

Please sign in to comment.