Fix error when nick is null #139

Closed
wants to merge 1 commit into
from

Projects

None yet

3 participants

@jisaacks

You are checking if PASS is null but not NICK, I was getting an error on line 695:

if ( args[args.length-1].match(/\s/) || args[args.length-1].match(/^:/) || args[args.length-1] === "" ) {

The error was:

TypeError: Cannot call method 'match' of null

Because self.opt.nick was null

I just added the same logic to not send nick if it is null.

@damianb
Contributor
damianb commented Jan 21, 2013

...actually, nick shouldn't be null at all - it should always be sent or the code should fatal. IRC spec demands a nick value.

👎

edit: REFERENCE RFC 1459, CHAPTER 4.1: http://www.irchelp.org/irchelp/rfc/chapter4.html#c4_1

@martynsmith
Owner

Yeah, as per what damianb just said, I think probably we should be throwing an error if nick is null, clearly the error that happens at the moment isn't ideal, but if you'd like to submit a pull request that throws a more sensible error I'm all for it :-)

@martynsmith martynsmith closed this Sep 6, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment